Opened 11 years ago

Closed 11 years ago

Last modified 4 years ago

#9046 closed defect (fixed)

[regression] Grid With XDomain: Permission denied to set property Window.onresize

Reported by: anthonywatson Owned by: Bryan Forbes
Priority: high Milestone: 1.3.1
Component: DojoX Grid Version: 1.3.0
Keywords: Cc: Nathan Toone
Blocked By: Blocking:

Description

When I tried to upgrade from Dojo 1.2.3 to 1.3, I get an error in Firefox 3 and IE 6 that is coming from DataGrid?.xd.js. The error is 'Permission denied to set property Window.onresize'. This error happens only when Dojo is deployed to a different server than my web application. The error goes away when I change back to referring to the 1.2 version of dojo.xd.js. I am using the Google xdomain files. The attached HTML should demonstrate the error.

Attachments (2)

dojoGridInlineStore.jsp (1.8 KB) - added by anthonywatson 11 years ago.
FirebugError.png (12.9 KB) - added by Nathan Toone 11 years ago.
The error that firebug throws...both of the anonymous functions are the "javascript:..." string

Download all attachments as: .zip

Change History (22)

Changed 11 years ago by anthonywatson

Attachment: dojoGridInlineStore.jsp added

comment:1 Changed 11 years ago by Adam Peller

Keywords: 13 added

comment:2 Changed 11 years ago by bill

Milestone: tbd1.3.1
Summary: Grid With XDomain: Permission denied to set property Window.onresize[regression] Grid With XDomain: Permission denied to set property Window.onresize

Hmm, given that this is a regression, should we target it for 1.3.1? I'll mark it preliminarily so but feel free to change it.

FYI that test case attached above is plain HTML, so no need to worry about installing tomcat etc.

comment:3 Changed 11 years ago by Jared Jurkiewicz

Resolution: fixed
Status: newclosed

(In [17356]) Fixing regression caused by src being set to effectively a cross-domain file which causes the functions of the iframe to be inaccessible. Also fixed an indent tabs/spaces problem. Followon tweak. Order change needed for safari. fixes #9046

comment:4 Changed 11 years ago by Jared Jurkiewicz

(In [17357]) Fixed an indent tabs/spaces problem. Followon tweak. refs #9046

comment:5 Changed 11 years ago by Jared Jurkiewicz

This was also checked into 1.3.1 branch under changesets: [17353] [17355] [17357]

I cleaned up some ordering and tabs/spaces too.

Tested on FF2, Safari 3.1, Google chrome, and IE 7.

comment:6 Changed 11 years ago by Jared Jurkiewicz

Note: The use of javascript: is a neat trick discovered by doughays regarding SSL and cross-site URL loading. It avoids IE's secure/insecure warning AND eliminates the need to actually load a file.

The problem here was caused by the src URL (blank.html), being considered 'cross-domain'. What that then did was disable access to setting the onload handlers and onresize handlers.

What the fix does is make the src have a value that isn't treated cross-domain so the handers can be set. It also reordered when it got set to make sure safari didn't fire onload before the handler was put in place.

comment:7 Changed 11 years ago by Jared Jurkiewicz

The reason this worked in 1.2 was 1.2 didn't set the src attribute. Well, that avoided this problem ... but produced secure/insecure warnings on IE. Anyway, should be fixed now.

comment:8 Changed 11 years ago by Nathan Toone

Resolution: fixed
Status: closedreopened

This fix causes weird things to happen when you focus on the firebug console....throwing the error "window.console is undefined".

To see an example of this, just load up any of the grid tests in FF and then click in the firebug console's entry box (make sure you don't have focus in that box before loading the page...I used dojox/grid/tests/test_data_grid.html)

Changed 11 years ago by Nathan Toone

Attachment: FirebugError.png added

The error that firebug throws...both of the anonymous functions are the "javascript:..." string

comment:9 Changed 11 years ago by Nathan Toone

Cc: Nathan Toone added

comment:10 Changed 11 years ago by Jared Jurkiewicz

That's ... bizarre.

comment:11 Changed 11 years ago by Jared Jurkiewicz

This looks like a firebug bug. Firebug is inserting a firebug DIV in the HTML for the iframe. See:

<div id="_firebugConsole" style="display: none;" FirebugVersion?="1.3.0"/>

But sometimes the frame's 'console' object is undefined (usually after a refresh without clearing cache). Then that error gets thrown.

comment:12 Changed 11 years ago by Jared Jurkiewicz

There's a known race condition with console: http://fbug.googlecode.com/svn/branches/firebug1.3/docs/ReleaseNotes_1.3.txt

They did work in 1.3 to make it less likely to hit, but it still comes up sometimes.

So ... there is a workaround. Testing it out now.

comment:13 Changed 11 years ago by Jared Jurkiewicz

(In [17385]) Checking in a fix that works around a firebug race condition. refs #9046

comment:14 Changed 11 years ago by Jared Jurkiewicz

(In [17386]) Checking in a fix that works around a firebug race condition. refs #9046

comment:15 Changed 11 years ago by Jared Jurkiewicz

(In [17387]) Checking in a fix that works around a firebug race condition. refs #9046

comment:16 Changed 11 years ago by Jared Jurkiewicz

(In [17388]) Checking in a fix that works around a firebug race condition. refs #9046

comment:17 Changed 11 years ago by Jared Jurkiewicz

Resolution: fixed
Status: reopenedclosed

I think it is fixed with the latest tweaks.

comment:18 Changed 10 years ago by Adam Peller

Keywords: Grid 13 removed

comment:19 Changed 4 years ago by iDo

Hi, 6 years after, I bet the workaround is not needed anymore. As it creates a useless iframe, can you consider removing it ? If yes, I can create a pull request

See complains: http://stackoverflow.com/questions/31165215/dojo-adding-iframe-with-loadfirebugconsole-how-to-disable

comment:20 Changed 4 years ago by bill

What do you mean by "the workaround"? Are you talking about [17385]? I'm fine to remove that if it's not needed anymore. Apparently you can test if it's needed by

just load up any of the grid tests in FF and then click in the firebug console's entry box (make sure you don't have focus in that box before loading the page...I used dojox/grid/tests/test_data_grid.html)

Note: See TracTickets for help on using tickets.