We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 25d8973 commit e3fe3c6Copy full SHA for e3fe3c6
test/e2e/index.js
@@ -21,14 +21,13 @@ $("[data-action=setup]")
21
}
22
});
23
24
-let scope = null
+let scope = null;
25
+let serviceWorkerUrl = "sw.min.js";
26
if (window.location.hostname === "leanplum.github.io") {
- scope = "/Leanplum-JavaScript-SDK/";
27
+ scope = window.location.pathname; // GH-pages guarantees ending slash
28
+ serviceWorkerUrl = scope + serviceWorkerUrl;
29
-Leanplum.setWebPushOptions({
- serviceWorkerUrl: window.origin + window.location.pathname + "/sw.min.js",
30
- scope
31
-})
+Leanplum.setWebPushOptions({ serviceWorkerUrl, scope });
32
33
$("#registerForWebPush")
34
.click(() => Leanplum.registerForWebPush().then(refreshWebPush));
0 commit comments