Comments (15)
Hello
best to use the Chrome console/dev tools in order to see if the script is loading. You'll also see that your website produces a few 404's...
As far as I can see, the script is not loading on your website.
from jekyll-pwa.
Which script should I look for?
Those 404's can be fixed by adding, {{site.baseurl}}. But is that enough?
from jekyll-pwa.
Locally I get
workbox Welcome to Workbox! /assets/js/workbox-v3.6.3/workbox-core.dev.js:132:21
workbox Precaching is responding to: / /assets/js/workbox-v3.6.3/workbox-core.dev.js:132:21
workbox Precaching is responding to: /js/footer.js /assets/js/workbox-v3.6.3/workbox-core.dev.js:132:21
workbox Welcome to Workbox! workbox-core.dev.js:132:21
workbox Precaching 0 files. 9 files are already cached. workbox-core.dev.js:132:21
in console. But in site I can't see this.
from jekyll-pwa.
perfect!
You can only see this in dev mode but not when live - this is intentional!
This means its working perfectly fine.
Now when you open the website on your mobile device, it'll ask you to install it and the icon as defined in your manifest will appear on your home screen.
from jekyll-pwa.
But in my site here I get Service worker is not registered or does not control the Start URL
in Application tab of console. I can access https://forumkeralam.ml/service-worker.js but can't access https://forumkeralam.ml/assets/js/workbox-v3.6.3/workbox-sw.js or https://forumkeralam.ml/assets/js/workbox-v3.6.2/workbox-sw.js
from jekyll-pwa.
Locally in http://localhost:4000/service-worker.js
I have
importScripts("/assets/js/workbox-v3.6.3/workbox-sw.js");
workbox.setConfig({modulePathPrefix: "/assets/js/workbox-v3.6.3"});
self.__precacheManifest = [{"url":"/js/footer.js","revision":"b3f41834b1eb54df1a50d30c2bde6556"},{"url":"/js/lunr.min.js","revision":"57fc8edbd9ac8ed0e94dbfca3f722ea8"},{"url":"/js/search.js","revision":"8043965b6a3727e172b7b4b7f03a4bc0"},{"url":"/index.html","revision":"cfbd3aa3bf6a70aa35cf8c085f6b4c04"},{"url":"/howto/2016/12/28/How-to-download-wikipedia-and-use-offline.html","revision":"16aaca7174ea6c0fb20e7258f6898432"},{"url":"/howto/2016/12/08/how-to-type-malayalam-in-android-phone-easily.html","revision":"f648f26613ff54d460b07daf4b7bfa83"},{"url":"/howto/2016/11/23/how-to-download-videos-from-youtube-without-any-software-easily.html","revision":"7e006a4803d1cb44f4a40e09d11bbb84"},{"url":"/howto/2016/11/17/How-to-download-softwares-and-movies-files-from-torrent-sites.html","revision":"69c43b33d24b9d54c3202c1cccf7a94b"},{"url":"/howto/2016/11/16/How-to-take-screenshot-of-monitor-screen.html","revision":"6d4bc63c8dde28e06a3dacc8505f24e2"}];
workbox.core.setCacheNameDetails({
prefix: 'xiaop-blog',
suffix: 'v1',
precache: 'precache',
runtime: 'runtime-cache'
});
workbox.skipWaiting();
workbox.clientsClaim();
workbox.precaching.precacheAndRoute(self.__precacheManifest);
workbox.routing.registerRoute(
/\.html$/,
workbox.strategies.networkFirst()
);
workbox.routing.registerRoute(
/assets\/(img|icons)/,
workbox.strategies.cacheFirst()
);
workbox.routing.registerRoute(
/^https?:\/\/cloud.netlifyusercontent.com/,
workbox.strategies.staleWhileRevalidate()
);
workbox.routing.registerRoute(
/^https?:\/\/cdn.staticfile.org/,
workbox.strategies.staleWhileRevalidate()
);
workbox.routing.registerRoute(
/^https?:\/\/at.alicdn.com/,
workbox.strategies.staleWhileRevalidate()
);
But on site in https://forumkeralam.ml/service-worker.js
I have
workbox.core.setCacheNameDetails({
prefix: 'xiaop-blog',
suffix: 'v1',
precache: 'precache',
runtime: 'runtime-cache'
});
workbox.skipWaiting();
workbox.clientsClaim();
workbox.precaching.precacheAndRoute(self.__precacheManifest);
workbox.routing.registerRoute(
/\.html$/,
workbox.strategies.networkFirst()
);
workbox.routing.registerRoute(
/assets\/(img|icons)/,
workbox.strategies.cacheFirst()
);
workbox.routing.registerRoute(
/^https?:\/\/cloud.netlifyusercontent.com/,
workbox.strategies.staleWhileRevalidate()
);
workbox.routing.registerRoute(
/^https?:\/\/cdn.staticfile.org/,
workbox.strategies.staleWhileRevalidate()
);
workbox.routing.registerRoute(
/^https?:\/\/at.alicdn.com/,
workbox.strategies.staleWhileRevalidate()
);
It is working locally, but on github pages it not works :(
from jekyll-pwa.
looks like the gem doesn't work when you deploy your site.
check your build/deploy procedures.
from jekyll-pwa.
I issued following commands
git add .
git commit -am "update"
git push origin gh-pages
from jekyll-pwa.
Sorry, I don't use gh-pages, so can't help...
from jekyll-pwa.
Okey, Thanks for the support
from jekyll-pwa.
I think there is a bug with gem version 2.2.2, script is looking for the folder workbox-v3.6.2
but the real folder exists is workbox-v3.6.3
. And for some reason gem version 2.2.3 is not working with gh-pages.
from jekyll-pwa.
Don't worry, the Workbox files are stored with the gem, so this can't be the issue.
do you get any feedback from gh pages as described here:
https://help.github.com/en/articles/troubleshooting-github-pages-builds
from jekyll-pwa.
I don't have any build errors with my repo. It was a success
from jekyll-pwa.
hmmm, in which case the gem should work.
I would recommend to check gh pages help docs. There's a good chance that gh-pages only allows certain gems...
from jekyll-pwa.
Ohhh! That may be the issue. Thanks for pointing that.
from jekyll-pwa.
Related Issues (20)
- How to add html pages to runtime cache HOT 2
- AMP support? HOT 9
- Consolidate settings in _config.yml?
- No need to set the cache header for the service worker since Chrome 68
- Trying to make cache fetch work HOT 1
- Content Security Policy
- CSP: feature request HOT 4
- gh-pages support HOT 3
- Error during service worker registration: TypeError: Failed to register a ServiceWorker: ServiceWorker script evaluation failed HOT 1
- How to clear cache? HOT 1
- Event.initEvent() has been deprecated HOT 2
- How to listen for sw.update? HOT 1
- undefined local variable or method `page' for Jekyll:Module HOT 3
- jekyll-pwa-plugin.rb:161:in `block in <module:Jekyll>': undefined local HOT 6
- Images Not Caching HOT 1
- Migrate from Workbox v2 to v3 HOT 2
- Adding plugins HOT 2
- Service worker not being injected HOT 2
- undefined method `+' for nil :NilClass HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jekyll-pwa.