-
Notifications
You must be signed in to change notification settings - Fork 12
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
fix(split links): run in iframes in Chrome and Violentmonkey Beta #504
Conversation
/deploy-preview for testing. |
fix(split links): run in iframes in Chrome (#504)
This PR changes 1 built userscript(s):
|
Codecov Report
@@ Coverage Diff @@
## main #504 +/- ##
==========================================
- Coverage 99.91% 99.67% -0.25%
==========================================
Files 53 53
Lines 1228 1230 +2
Branches 195 196 +1
==========================================
- Hits 1227 1226 -1
- Misses 0 3 +3
Partials 1 1
Continue to review full report at Codecov.
|
01b26b2
to
3fa765f
Compare
/deploy-preview new fix |
fix(split links): run in iframes in Chrome (#504)
Chrome does not fire the window load event on iframe windows, Firefox doesn't fire the DOMContentLoaded event. Instead, we should just listen for the iframe load event itself, rather than load events on the contained window or document.
3fa765f
to
02b5973
Compare
/deploy-preview again, better approach. Not sure where my head is at these days. |
fix(split links): run in iframes in Chrome (#504)
I think chaban confirmed that the last attempt did fix the problem. This fix should go into the work code toolbox in #499 too. |
fix(split links): run in iframes in Chrome and Violentmonkey Beta (#504)
🚀 Released 1 new userscript version(s):
|
Fixes issue reported by chaban in the forums.
We already knew that Firefox doesn't fire the
DOMContentLoaded
event, which is why we were listening to the iframe window'sload
event. However, it turns out that Chrome doesn't fire that event.I also tried mutation observers, they don't work either. I'm not sure whether Chrome fires theTurns out the simple solution is just to listen for theDOMContentLoaded
event, but considering that the iframe's documentreadyState
attribute is set to'complete'
immediately makes me doubt that. So we'll resort to the simplest approach: Continuous polling (eww!).load
event on the iframe itself.I'm not 100% certain the issue chaban is seeing, but I couldn't reproduce it on Firefox, and it was broken in Chrome either way, so it needed fixing. I'll ask chaban to test this as well to verify that the problem is solved.
We'll also need to apply this to
Work code toolbox
in #499.