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
Reload nested iframe in webview causes memory leak in electron@5.0.0 #18019
Comments
you probably dont want to be disabling webSecurity in you app in the first place what exactly are you trying to accomplish with nested iframes like that anyway? maybe you should look into single page application frameworks such as angular or ionic to manage paging in your app. This is much more secure and you gain alot of control over your app this way. [edit]: This is also a chromium issue not electrons problem |
@Nick-lab Thanks for advice, but in my situation I've to use nested iframes because the webpage is from another website that not controlled by me. |
This problem still occurs in 5.0.1 and 6.0.0-beta.1 |
Seems fixed in 6.0.0-beta.2 |
Not fixed in 5.0.2 |
Also seeing this issue. Is there a plan to fix this is v5? if not do we know when 6x is planned for release? Thanks |
Seems fixed by #18976 in electron@5.0.7 |
Preflight Checklist
Issue Details
Expected Behavior
If reload a nested iframe inside webview, the old iframe will be removed from memory.
Actual Behavior
The old iframe is still existed in memory and still working (e.g, still playing videos)
To Reproduce
Clone an reproduce example.
$ git clone https://github.com/KochiyaOcean/electron-bugs.git -b webview-nested-iframe-memory-leak $ electron .
Play youtube video in the webview.
Run
$('webview').executeJavaScript("document.querySelector('iframe').src = document.querySelector('iframe').src")
in devtools.The iframe is reloaded, but the former iframe is still existed. The video in former iframe is still playing, and the memory of former iframe is not recycled.
Which means:
Screenshots
Additional Information
There is another problem seems related: If disable webview's webSecurity option, the CORS policy of nested iframe inside the webview will still keep working, which should be also disabled.
The text was updated successfully, but these errors were encountered: