Ticket #2723 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

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

Reported by: guest Owned by: bill
Priority: normal Milestone: 0.9
Component: Dijit Version: 0.4.1
Severity: normal Keywords: cross domain popupcontainer
Cc:

Description

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.

Cause:

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

Fix:

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

popupcontainer_xd.patch (0.7 kB) - added by guest 3 years ago.

Change History

Changed 3 years ago by guest

Changed 3 years ago by guest

grr. Trac lost my name :(

chuck robert.coup@… into the CC

Changed 3 years ago by bill

  • component changed from Widgets to Dijit
  • milestone set to 1.0

Changed 3 years ago by bill

  • status changed from new to closed
  • resolution set to fixed
  • milestone changed from 1.0 to 0.9
Note: See TracTickets for help on using tickets.