Skip to content

Commit 922aa04

Browse files
PWA manifest: allow custom start_url (#1094)
Co-authored-by: Maxence Charriere <charriere@outlook.com>
1 parent f671929 commit 922aa04

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

pkg/app/http.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ type Handler struct {
124124
// paths prefixed with "/web/". Defaults to app.LocalDir("").
125125
Resources ResourceResolver
126126

127+
// StartURL is the URL opened by default when the installed PWA is opened.
128+
// This, however, does not affect the default URL when the app is opened
129+
// as normal website in the browser. Defaults to "/".
130+
StartURL string
131+
127132
// Version defines the app's version. It's crucial for determining if an
128133
// update is available. Must be set in live environments to avoid recurring
129134
// updates. Auto-generated by default for local development updates.
@@ -408,7 +413,7 @@ func (h *Handler) makeManifestJSON() []byte {
408413
Name: h.Name,
409414
Description: h.Description,
410415
Scope: "/",
411-
StartURL: h.Resources.Resolve("/"),
416+
StartURL: h.Resources.Resolve(h.StartURL),
412417
BackgroundColor: h.BackgroundColor,
413418
ThemeColor: h.ThemeColor,
414419
Display: "standalone",

0 commit comments

Comments
 (0)