Skip to content

Commit

Permalink
Merge pull request #1098 from sbwalker/dev
Browse files Browse the repository at this point in the history
fix #1097 - made PWA manifest Urls absolute rather than relative
  • Loading branch information
sbwalker authored Feb 10, 2021
2 parents 1fcb2ee + 2fc877a commit 22830a2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Oqtane.Client/UI/ThemeBuilder.razor
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,24 @@

private async Task InitializePwa(Interop interop)
{
string url = NavigationManager.BaseUri;
url = url.Substring(0, url.Length - 1);

// dynamically create manifest.json and add to page
string manifest = "setTimeout(() => { " +
"var manifest = { " +
"\"name\": \"" + PageState.Site.Name + "\", " +
"\"short_name\": \"" + PageState.Site.Name + "\", " +
"\"start_url\": \"/\", " +
"\"start_url\": \"" + url + "/\", " +
"\"display\": \"standalone\", " +
"\"background_color\": \"#fff\", " +
"\"description\": \"" + PageState.Site.Name + "\", " +
"\"icons\": [{ " +
"\"src\": \"" + Utilities.ContentUrl(PageState.Alias, PageState.Site.PwaAppIconFileId.Value) + "\", " +
"\"src\": \"" + url + Utilities.ContentUrl(PageState.Alias, PageState.Site.PwaAppIconFileId.Value) + "\", " +
"\"sizes\": \"192x192\", " +
"\"type\": \"image/png\" " +
"}, { " +
"\"src\": \"" + Utilities.ContentUrl(PageState.Alias, PageState.Site.PwaSplashIconFileId.Value) + "\", " +
"\"src\": \"" + url + Utilities.ContentUrl(PageState.Alias, PageState.Site.PwaSplashIconFileId.Value) + "\", " +
"\"sizes\": \"512x512\", " +
"\"type\": \"image/png\" " +
"}] " +
Expand Down

0 comments on commit 22830a2

Please sign in to comment.