Opened 12 years ago

Closed 12 years ago

#3972 closed defect (fixed)

PopupContainer on a page with a cross-domain IFRAME kills Dojo in Safari

Reported by: guest Owned by: bill
Priority: high Milestone: 0.9
Component: Dijit Version: 0.4.1
Keywords: cross domain popupcontainer safari Cc: mpirnat@…
Blocked By: Blocking:

Description

Related to #2723 (PopupContainer load error within a cross-domain IFRAME), any use of a PopupContainer?-based widget on a page which contains a cross-domain IFRAME (such as a third-party advert) will bring Dojo to a complete stop in Safari.

The problem lies in dojo.html.util.getDocumentWindow's Safari fix that recursively fixes up all document._parentWindow references. When it tries to set "win.document._parentWindow=win;" where "win" is the IFRAME, it throws a security error that no amount of try/catch will actually catch. At that point, anything Dojo-related on your page is dead and gone and will not function.

This happens in 0.4.3 and 0.9 as well (though it looks like in 0.9, the code in question has moved into dijit.util.window).

I have prepared a very simple patch for 0.4.1 that resolves this but can't submit it yet (I'm waiting on The Powers That Be to sign and submit the Corporate CLA).

Change History (3)

comment:1 Changed 12 years ago by bill

Component: GeneralDijit
Milestone: 1.0
Owner: changed from anonymous to bill

I really don't understand the reason for this function altogether. The code that calls it already has a pointer to the window object, so it seems like a fancy no-op.

comment:2 Changed 12 years ago by guest

In Safari, window.top.document._parentWindow is undefined... the purpose appears to be to fix that reference, and to recursively fix it across all frames within the window. It may be that this is not needed, but if it is necessary (it seemed to be when I was first attacking this strangeness, but I can't seem to make it upset by taking it out again now, go figure), a simple solution is to patch the fix function to check to see if win.document exists before trying to set win.document._parentWindow. Apparently we've submitted a CCLA now, so I can submit a patch for that if you want it.

-- Mike | mpirnat@…

comment:3 Changed 12 years ago by bill

Milestone: 1.00.9
Resolution: fixed
Status: newclosed

Fixed in [10014]

Note: See TracTickets for help on using tickets.