Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#1164 closed defect (fixed)

dojo.widget.PopupManager initialization fails with cross-domain-iframes

Reported by: rsaccon [at] gmail [dot] com Owned by: liucougar
Priority: high Milestone:
Component: Widgets Version: 0.3
Keywords: Cc:
Blocked By: Blocking:


I discovered this annoyance when embedding Google Adsense on the same page as dojo. Probably happens with any cross-domain-embedded iframes. I am using dojo trunk and on IE 6 I get the error message "access denied" and on firefox/firebug it either fails silently (can't explain why, but dojo.addOnLoad didn't work anymore) or it works (can't explain either !)

the problem happens at the following block within dojo.widget.PopupManager?:

       this.registerAllWindows = function(targetWindow){
               //starting from, clicking everywhere in this page
               //should close popup menus
               if(!targetWindow)  targetWindow =
dojo.html.getDocumentWindow(; //see comment below


               for (var i = 0; i < targetWindow.frames.length; i++){
                       //do not remove  dojo.html.getDocumentWindow, see comment in it
                       var win = dojo.html.getDocumentWindow(targetWindow.frames[i].document);

       dojo.addOnLoad(this, "registerAllWindows");

The simlpest way to make a test-case for this problem is to copy/paste a google adsense snippet (see below the mine) into dojo/tests/widgets/test_Menu2_Bar.html and open it in IE 6.

Google adssense snippet:

<script type="text/javascript"><!--
google_ad_client = "pub-7326210199806617";
google_ad_width = 120;
google_ad_height = 600;
google_ad_format = "120x600_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = "DDDDEE";
google_color_bg = "EAEAFF";
google_color_link = "0000AA";
google_color_text = "000000";
google_color_url = "008000";
<script type="text/javascript"

Change History (6)

comment:1 Changed 15 years ago by dylan

Milestone: 0.5
Version: 0.40.3

comment:2 Changed 15 years ago by dylan

Component: GeneralWidgets
Owner: changed from anonymous to bill

comment:3 Changed 15 years ago by liucougar

what about adding a "try/catch" around the offending block?

comment:4 Changed 15 years ago by liucougar

Milestone: 0.50.4
Owner: changed from bill to liucougar

comment:5 Changed 15 years ago by liucougar

Resolution: fixed
Status: newclosed

(In [5472]) fixes #1164: dojo.widget.PopupManager? initialization fails with cross-domain-iframes squelch the error for now (any better idea?)

comment:6 Changed 15 years ago by (none)

Milestone: 0.4

Milestone 0.4 deleted

Note: See TracTickets for help on using tickets.