Closed
Description
When running $.text() on window, while there are cors iframes on the page throws an exception.
STR:
- Open a page with that have at least one iframe from a different domain.
- run $(window).text() .
- What do you expect to happen?
Return empty string/undefined
- What actually happens?
Throws exception (cors/security 18)
- Which browsers are affected?
(WebKit/gecko based at least)
minimal testcase -> https://jsfiddle.net/xpvt214o/127474/
- why is it happening?
a. it seems that Sizzel.getText function assumes that if the parameter sent have no .nodeType property, it must be an array, so it's start iterating the element indexes,
b. when adding iframes to the document there is a reference also on the window object
window[0...n] (n - the number of frames on the page)
so when sending the window object, it iterates also the inaccessible windows and try to access their .nodeType prop which throws an exception.
Metadata
Metadata
Assignees
Labels
No labels