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

Demo doesen't work in firefox #60

Closed
goleary opened this issue May 10, 2021 · 9 comments · Fixed by #62
Closed

Demo doesen't work in firefox #60

goleary opened this issue May 10, 2021 · 9 comments · Fixed by #62
Assignees

Comments

@goleary
Copy link

goleary commented May 10, 2021

Super useful polyfill & utility functions, thanks!

I tried the demo on Firefox and it does not work:
image

Env:
Windows 10
Firefox 88.0.1

@goleary goleary changed the title Demo doesen't work on firefox Demo doesen't work in firefox May 10, 2021
@tomayac
Copy link
Member

tomayac commented May 11, 2021

@tfmar Any idea what could have caused this? It definitely was working before. There is no error on the console either.

@tomayac
Copy link
Member

tomayac commented May 12, 2021

Both reports were for Firefox 88 (88.0.1). Anything that sticks out in the release notes that looks problematic?

@tomayac
Copy link
Member

tomayac commented May 19, 2021

@sebsg or @SebLalancette, while @tfmar is OoO, are you able to look into this?

@cadeyrn
Copy link

cadeyrn commented May 19, 2021

Works for me in Firefox ESR 78, Firefox 88 and in Firefox 90 Nightly. It's important that you use the context menu item at least once otherwise the add-on doesn't trigger the permission prompt for the optional permission to access website data. After granting the permission it works.

@goleary
Copy link
Author

goleary commented May 19, 2021

@cadeyrn Unless I'm missing something this has nothing to do with the extension.

I assumed the polyfill was added to the website itself and therefore did not require using the extension.

@cadeyrn
Copy link

cadeyrn commented May 19, 2021

Sorry, then I misunderstood. But without extension it doesn't work in Firefox ESR 78 either, so it's not a new issue in Firefox 88.

@guillaumejenkins
Copy link
Collaborator

I can repro in FF 88 on Windows 10. Some preliminary debugging shows that init() is never called.

When setting a breakpoint, document.readyState has the value 'interactive', so the code starts listening for the DOMContentLoaded event. Strangely, the event never seems to fire. I have tried setting an event breakpoint on the DOMContentLoaded event, but I never hit it. Perhaps the page is so simple that the event has already fired by the time the breakpoint is applied?

In any case, the issue seems to be that document.readyState isn't what we expect it to be (i.e. 'complete'), but the DOMContentLoaded event has already fired when we start listening to it, so init() is never called.

@ghost
Copy link

ghost commented May 20, 2021

Simplifying the last few lines to just run init() works fine in my testing.

@tomayac
Copy link
Member

tomayac commented May 21, 2021

Thanks, @guillaumejenkins, for the fix. I have just released v3.3.0 on npm that contains this fix. I let you have a go at #61, and once this is closed, I will release a new version of the Firefox and Safari extensions (which is always a bit of a hassle).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants