diff --git a/index.html b/index.html index 282b4fc6..bb320c7a 100644 --- a/index.html +++ b/index.html @@ -63,7 +63,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN /** * [polymer-root-path] * - * By default, we set `Polymer.rootPath` to the server root path (`/`). * Leave this line unchanged if you intend to serve your app from the root * path (e.g., with URLs like `my.domain/` and `my.domain/view1`). * @@ -72,13 +71,13 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN * to indicate the path from which you'll be serving, including leading * and trailing slashes (e.g., `/my-app/`). */ - window.Polymer = { rootPath: '/' }; + window.MyAppGlobals = { rootPath: '/' }; // Load and register pre-caching Service Worker if ('serviceWorker' in navigator) { window.addEventListener('load', function() { navigator.serviceWorker.register('service-worker.js', { - scope: Polymer.rootPath + scope: MyAppGlobals.rootPath }); }); } diff --git a/src/my-app.js b/src/my-app.js index c8dee8b0..ca79032b 100644 --- a/src/my-app.js +++ b/src/my-app.js @@ -27,7 +27,9 @@ import './my-icons.js'; // preventable, allowing for better scrolling performance. setPassiveTouchGestures(true); -setRootPath(Polymer.rootPath); +// Set Polymer's root path to the same value we passed to our service worker +// in `index.html`. +setRootPath(MyAppGlobals.rootPath); class MyApp extends PolymerElement { static get template() {