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

<iframe> inside ShadowDOM will cause extension script hang #105

Open
gdh1995 opened this issue Oct 18, 2021 · 4 comments
Open

<iframe> inside ShadowDOM will cause extension script hang #105

gdh1995 opened this issue Oct 18, 2021 · 4 comments

Comments

@gdh1995
Copy link

gdh1995 commented Oct 18, 2021

Platform: Chrome 94, Win 10 / macOS 11.4
Extension: Katalon Recorder (Selenium tests generator) 5.5.4.8

One line description

If a page creates a Shadow DOM tree and then insert <iframe></iframe> into the tree, then this extension's content script will enter a dead loop and the whole page hangs.

Test steps

A simple test is: install Vimium C (https://github.com/gdh1995/vimium-c) and press / on a Google page. If without this extension, Vimium C should show a small input box at the bottom right corner and a user can type letters to search.

But with this enabled, a test page will hang (as reported in gdh1995/vimium-c#457).

Buggy point

while (currentWindow !== window.top) {
currentParentWindow = currentWindow.parent;
for (let idx = 0; idx < currentParentWindow.frames.length; idx++)
if (currentParentWindow.frames[idx] === currentWindow) {
frameLocation = ":" + idx + frameLocation;
currentWindow = currentParentWindow;
break;
}
}
return frameLocation = "root" + frameLocation;

Here frames won't include child frames inside Shadow DOM trees, so currentWindow won't be updated, and then currentWindow !== window.top is always true.

@minhthanh3145
Copy link
Contributor

Thank you for the report, we'll fix it and include it in the upcoming releases.

@gdh1995
Copy link
Author

gdh1995 commented Mar 22, 2022

Any updates?

@greyfx80
Copy link

greyfx80 commented May 2, 2022

This issue is still occurring with Chrome extension 5.8.1 and my shadow dom that I am attempting to record does NOT have an iframe in it. In fact, it breaks the shadow dom causing the browser to freeze and having to force quit the entire browser without even trying to record. Had to turn off the extension to stop it from breaking the shadow dom. This is occurring on both Mac (Chrome v. 101) and Windows(Chrome v. 89) in either incognito or regular.

@gdh1995
Copy link
Author

gdh1995 commented Aug 12, 2022

Hello, could you fix this in a next release? Another user of my extension also met this crash.

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

No branches or pull requests

3 participants