Opened 15 years ago

Closed 15 years ago

#2723 closed defect (fixed)

[patch][ccla] PopupContainer load error within a cross-domain IFRAME

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


If PopupContainer? is loaded from within an IFRAME that is loaded cross-domain from the original page, an error occurs (FF,IE,Opera).

In Firefox the error is:

[Exception... "'Permission denied to get property HTMLDocument._parentWindow' when calling method: [nsIDOMEventListener::handleEvent]" nsresult: "0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)" location: "<unknown>" data: no]

Steps to reproduce:

  1. load test_Menu2.html cross-domain from within an iframe.
  2. above error happens during dojo onLoad processing.


PopupManager?.registerAllWindows() calls dojo.html.getDocumentWindow() which tries to access the _parentWindow property of the outer window, which violates the rules.


The attached patch fixes my test case, by catching the error and falling back to working from the IFRAME window - which isn't ideal, but a sensible fallback and no errors.

It might be one idea to look at d.html.getDocumentWindow, but there are a number of other try-catch blocks around it throughout the code, so presumably it's not regarded as error-safe.

Attachments (1)

popupcontainer_xd.patch (716 bytes) - added by guest 15 years ago.

Download all attachments as: .zip

Change History (4)

Changed 15 years ago by guest

Attachment: popupcontainer_xd.patch added

comment:1 Changed 15 years ago by guest

grr. Trac lost my name :(

chuck [email protected]… into the CC

comment:2 Changed 15 years ago by bill

Component: WidgetsDijit
Milestone: 1.0

comment:3 Changed 15 years ago by bill

Milestone: 1.00.9
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.