Opened 14 years ago
Closed 14 years ago
#3573 closed defect (fixed)
popup: window.top reference throws exception in iframe
Reported by: | Adam Peller | Owned by: | bill |
---|---|---|---|
Priority: | high | Milestone: | 0.9 |
Component: | Dijit | Version: | 0.9 |
Keywords: | Cc: | James Burke | |
Blocked By: | Blocking: |
Description
in this._onEvent. One of these references is wrapped in a try/catch with a squelch, the other is not. I think we need to wrap both. Is it necessary to start from 'top' here?
Change History (8)
comment:1 Changed 14 years ago by
comment:2 Changed 14 years ago by
It's certainly better to start from top. The goal is that clicking anywhere in the browser window closes the drop down. But I guess if it's not possible then it's not possible.
I don't really understand Adam's description. There are two references to window.top on the same line, but that line isn't in _onEvent.
comment:3 Changed 14 years ago by
Yes, the problem I was referring to would be caused by the _connectHandlers function in diijit/util/popup.js, where it uses window.top, then later tries to do a dojo.connect with its document.
comment:4 Changed 14 years ago by
So the first time through _connectHandlers, when no targetWindow is passed, would be the problem case.
comment:6 Changed 14 years ago by
I put in a try/catch in lieu of a better solution. Leaving open in case jburke has any suggestions.
comment:7 Changed 14 years ago by
Cc: | James Burke added |
---|
comment:8 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
OK, I guess this is the best we can do. Closing bug.
This issue just bit me in 0.4.3 (in that codebase, it is function dojo.widget.PopupManager?.registerAllWindows in src/widget/PopupContainer.js).
My test case: I had a page on a different domain with an iframe that loaded the page that had a dojo menu (the top page did not need to communicate with the iframe page). In that case I got a security exception since the code tries to add a property to top's document.
It seems like reevaluating if it needs to start at top or putting the code in a try catch might be useful. Right now I have an ugly hack to avoid the issue in 0.4.3.