GithubHelp home page GithubHelp logo

Comments (15)

souldanger avatar souldanger commented on June 10, 2024

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.

bsde1245 avatar bsde1245 commented on June 10, 2024

Which script should I look for?
Those 404's can be fixed by adding, {{site.baseurl}}. But is that enough?

from jekyll-pwa.

bsde1245 avatar bsde1245 commented on June 10, 2024

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.

souldanger avatar souldanger commented on June 10, 2024

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.

bsde1245 avatar bsde1245 commented on June 10, 2024

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.

bsde1245 avatar bsde1245 commented on June 10, 2024

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.

souldanger avatar souldanger commented on June 10, 2024

looks like the gem doesn't work when you deploy your site.
check your build/deploy procedures.

from jekyll-pwa.

bsde1245 avatar bsde1245 commented on June 10, 2024

I issued following commands
git add .
git commit -am "update"
git push origin gh-pages

from jekyll-pwa.

souldanger avatar souldanger commented on June 10, 2024

Sorry, I don't use gh-pages, so can't help...

from jekyll-pwa.

bsde1245 avatar bsde1245 commented on June 10, 2024

Okey, Thanks for the support

from jekyll-pwa.

bsde1245 avatar bsde1245 commented on June 10, 2024

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.

souldanger avatar souldanger commented on June 10, 2024

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.

bsde1245 avatar bsde1245 commented on June 10, 2024

I don't have any build errors with my repo. It was a success

from jekyll-pwa.

souldanger avatar souldanger commented on June 10, 2024

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.

bsde1245 avatar bsde1245 commented on June 10, 2024

Ohhh! That may be the issue. Thanks for pointing that.

from jekyll-pwa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.