fix(split links): run in iframes in Chrome and Violentmonkey Beta - #504
Merged
Conversation
Owner
Author
|
/deploy-preview for testing. |
github-actions Bot
added a commit
that referenced
this pull request
Jun 21, 2022
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.
|
ROpdebee
force-pushed
the
split-links-iframes-chrome
branch
from
June 22, 2022 09:24
01b26b2 to
3fa765f
Compare
Owner
Author
|
/deploy-preview new fix |
github-actions Bot
added a commit
that referenced
this pull request
Jun 22, 2022
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.
ROpdebee
force-pushed
the
split-links-iframes-chrome
branch
from
June 22, 2022 14:55
3fa765f to
02b5973
Compare
Owner
Author
|
/deploy-preview again, better approach. Not sure where my head is at these days. |
github-actions Bot
added a commit
that referenced
this pull request
Jun 22, 2022
fix(split links): run in iframes in Chrome (#504)
Owner
Author
|
I think chaban confirmed that the last attempt did fix the problem. This fix should go into the work code toolbox in #499 too. |
github-actions Bot
added a commit
that referenced
this pull request
Jun 27, 2022
fix(split links): run in iframes in Chrome and Violentmonkey Beta (#504)
|
🚀 Released 1 new userscript version(s):
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes issue reported by chaban in the forums.
We already knew that Firefox doesn't fire the
DOMContentLoadedevent, which is why we were listening to the iframe window'sloadevent. 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 theDOMContentLoadedevent, but considering that the iframe's documentreadyStateattribute is set to'complete'immediately makes me doubt that. So we'll resort to the simplest approach: Continuous polling (eww!).loadevent 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 toolboxin #499.