-
Notifications
You must be signed in to change notification settings - Fork 1.7k
support/fix window.frames #1928
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
Comments
We've decided to remove window.frames as it no longer appear to be commonly used - it's currently broken. The workaround should work for common cases: window.queryAll('iframe').map((f) => f.contentWindow); Please star if you'd like to see this added. cc @blois. |
Removed the owner. |
Added html-api label. |
Fixed as this API has been removed. Added Fixed label. |
window.frames currently returns the same instance window. In JS this works because the window is also an array that contains all the child frames.
This doesn't work in Dart because [] and .length are not supported on the returned type. We should probably update the return type to be more sensible (e.g. List<Window> get frames())
We can work around this for now to get frames by doing
window.queryAll('iframe')
and retrieving the window from the iframe element.
Fixing widnow.frames will still be important long term if we want to support accessing an grandchild-iframe (e.g. window.frames[0].frames[1]). This is because the window returned by the iframe element is more restricted and doesn't allow accessing its document content (e.g. the following is illegal: window.queryAll('iframe')[0].queryAll('iframe')[1])
The text was updated successfully, but these errors were encountered: