Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On some devices that do not support ServiceWorkers, a warning is displayed on every run #814

Closed
mossroy opened this issue Feb 3, 2022 · 7 comments · Fixed by #815
Closed
Assignees
Labels
regression Broken things that used to work
Milestone

Comments

@mossroy
Copy link
Contributor

mossroy commented Feb 3, 2022

At least it's the case on my Firefox OS device.
Each time I start it, it says "The ServiceWorker API is not available on your device. Falling back to jQuery mode". It's true, but I don't see why it's trying to switch to SW mode.

window.location is "app://kiwix.org/www/index.html" on this device, and it's using Local Storage.

@mossroy mossroy added this to the v3.3 milestone Feb 3, 2022
@Jaifroid Jaifroid self-assigned this Feb 4, 2022
@Jaifroid Jaifroid added the regression Broken things that used to work label Feb 4, 2022
@Jaifroid
Copy link
Member

Jaifroid commented Feb 4, 2022

Oh, how strange. It must be that isServiceWorkerAvailable() is returning true, as it's not supposed to attempt SW mode without that returning true...

I long since lost the portable Firefox that could run the simulator. Can you remind me which one still works, and I'll try to debug before 3.3. Or we can revert that PR for now if I can't find the cause (but seems unlikely it's anything complicated!).

@Jaifroid
Copy link
Member

Jaifroid commented Feb 4, 2022

(It's also strange that it would run with a protocol of app, as I explicitly selected only ^https?....).

@mossroy
Copy link
Contributor Author

mossroy commented Feb 4, 2022

I'll try to investigate today

@Jaifroid
Copy link
Member

Jaifroid commented Feb 4, 2022

OK, I was wondering if this is happening on the branch with the asynchronous systemAlert, or on master as well. If on the latter branch, it could be because of the alert system not being fully nailed down yet...

@mossroy
Copy link
Contributor Author

mossroy commented Feb 4, 2022

I was on the branch. I'll test again on master

@mossroy
Copy link
Contributor Author

mossroy commented Feb 4, 2022

Same issue on master.
After some debugging, I found the problem.
It's line 98 of app.js, where you set the injectionMode, and handle a default value if not already in settingsStore.
There are missing parenthesis that change the behavior.
I create a PR

@mossroy
Copy link
Contributor Author

mossroy commented Feb 4, 2022

It reminds me that it's still valuable that I test on this very old device.
Not because it's crucial to support it, but because it helps discover some bugs or issues (like performance ones)

@mossroy mossroy mentioned this issue Feb 4, 2022
18 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression Broken things that used to work
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants