Security error" code: "1000

S

Spizzat2

I've recently started using YAHOO!® User Interface library, and
noticed that I can consistently reproduce a security exception on a
certain page in Firefox with Firebug.
The error I get as the page is loading is
[Exception... "Security error" code: "1000" nsresult: "0x805303e8
(NS_ERROR_DOM_SECURITY_ERR)" location: "http://yui.yahooapis.com/combo?
2.7.0/build/yahoo/yahoo-debug.js&2.7.0/build/event/event-
debug.js&2.7.0/build/connection/connection-debug.js&2.7.0/build/
datasource/datasource-debug.js&2.7.0/build/dom/dom-debug.js&2.7.0/
build/autocomplete/autocomplete-debug.js&2.7.0/build/element/element-
debug.js&2.7.0/build/dragdrop/dragdrop-debug.js&2.7.0/build/container/
container-debug.js&2.7.0/build/menu/menu-debug.js&2.7.0/build/button/
button-debug.js&2.7.0/build/calendar/calendar-debug.js&2.7.0/build/
json/json-debug.js&2.7.0/build/charts/charts-debug.js&2.7.0/build/
paginator/paginator-debug.js&2.7.0/build/datatable/datatable-
debug.js&2.7.0/build/get/get-debug.js&2.7.0/build/logger/logger-
debug.js&2.7.0/build/selector/selector-debug.js&2.7.0/build/slider/
slider-debug.js&2.7.0/build/tabview/tabview-debug.js&2.7.0/build/
treeview/treeview-debug.js&2.7.0/build/uploader/uploader.js Line:
1262"] code=1000 INDEX_SIZE_ERR=1 DOMSTRING_SIZE_ERR=2

I can see that it's in the YUI framework.
It only occurs when I reload a certain page with the Firebug DOM tab
open. Any other Firebug tab, and it works just fine.
The error stops aspects of the page from working. I assume it just
stops anything YUI related, but I'm not sure about that yet.

Anyway, the code at/near line 1262 is this:

var args=[].slice.call(arguments, 0), ret=true, i,
rebuild=false;

if (!this.silent) {
YAHOO.log( "Firing " + this + ", " +
"args: " + args + ", " + //Line
1262
"subscribers: " + len,
"info", "Event" );
}

I don't see anything with that code that would cause an error, let
alone a security exception. Firebug tells me that args is always an
array, but it can contain anything from an XMLHttpRequest, to a
mouseclick event, to a function (I think this is when the code
breaks). It looks like the function is from an "onavailable" event,
though I'm not sure of that.
Any thoughts? I realize that not providing any non-YUI-code from the
page isn't terribly helpful, but it doesn't make sense to post all of
it, and I haven't figured out where it's coming from just yet.
 
S

Spizzat2

G

Garrett Smith

Stefan said:
I've recently started using YAHOO!® User Interface library, and
noticed that I can consistently reproduce a security exception on a
certain page in Firefox with Firebug.
The error I get as the page is loading is
[Exception... "Security error" code: "1000" nsresult: "0x805303e8
(NS_ERROR_DOM_SECURITY_ERR)" location: "http://yui.yahooapis.com/combo?
[[snip]] Line: 1262"] code=1000 INDEX_SIZE_ERR=1 DOMSTRING_SIZE_ERR=2

I can see that it's in the YUI framework.
It only occurs when I reload a certain page with the Firebug DOM tab
open. Any other Firebug tab, and it works just fine.

Do you see the same error in Firefox' Error Console?

What do you see when you click on the error message to go to the line
number?
 
S

Spizzat2

Stefan Weiss wrote:

Do you see the same error in Firefox' Error Console?


The error also shows up in Firefox's error console as:

Error: uncaught exception: [Exception... "Security error" code:
"1000" nsresult: "0x805303e8 (NS_ERROR_DOM_SECURITY_ERR)" location:
"http://yui.yahooapis.com/combo?2.7.0/build/yahoo/yahoo-debug.js&2.7.0/
build/event/event-debug.js&2.7.0/build/connection/connection-
debug.js&2.7.0/build/datasource/datasource-debug.js&2.7.0/build/dom/
dom-debug.js&2.7.0/build/autocomplete/autocomplete-debug.js&2.7.0/
build/element/element-debug.js&2.7.0/build/dragdrop/dragdrop-
debug.js&2.7.0/build/container/container-debug.js&2.7.0/build/menu/
menu-debug.js&2.7.0/build/button/button-debug.js&2.7.0/build/calendar/
calendar-debug.js&2.7.0/build/json/json-debug.js&2.7.0/build/charts/
charts-debug.js&2.7.0/build/paginator/paginator-debug.js&2.7.0/build/
datatable/datatable-debug.js&2.7.0/build/get/get-debug.js&2.7.0/build/
logger/logger-debug.js&2.7.0/build/selector/selector-debug.js&2.7.0/
build/slider/slider-debug.js&2.7.0/build/tabview/tabview-
debug.js&2.7.0/build/treeview/treeview-debug.js&2.7.0/build/uploader/
uploader.js Line: 1262"]
What do you see when you click on the error message to go to the line
number?

Looking at line 1262 (the line indicated in the error) shows the code
I provided in the first post. However, I looked at the stack at the
time of error, and it looks like it comes from a line in my code that
uses the YUI framework to handle the response to an ajax request that
occurs as the page is loading.

Offending Line: var sButton = new YAHOO.widget.Button
('startDateButton'); //Creates a YUI button for the calendar selector

The line seems pretty straight-forward. It then goes into YUI, running
a slew of anonymous functions. The last function to run before the
error is _setLabel, which appears to be part of the
YAHOO.widget.Button code (or possibly an extension of it, since it's
part of the YAHOO.extend() function; The problematic line there runs
this code: this._button.innerHTML = p_sLabel;
According to the stack, p_sLabel = '<img src="/images/calbtn.gif">',
which makes sense. It's the image we want as part of the button. I
know you can use an image in a YUI Button, because I've seen it done,
and it works most of the time on this page.

Is that any help?
 
G

Garrett Smith

Spizzat2 said:
Stefan Weiss wrote:

Do you see the same error in Firefox' Error Console?


The error also shows up in Firefox's error console as:

Error: uncaught exception: [Exception... "Security error" code:
"1000" nsresult: "0x805303e8 (NS_ERROR_DOM_SECURITY_ERR)" location:
"http://yui.yahooapis.com/combo?2.7.0/build/yahoo/yahoo-debug.js&2.7.0/
build/event/event-debug.js&2.7.0/build/connection/connection-
debug.js&2.7.0/build/datasource/datasource-debug.js&2.7.0/build/dom/
dom-debug.js&2.7.0/build/autocomplete/autocomplete-debug.js&2.7.0/
build/element/element-debug.js&2.7.0/build/dragdrop/dragdrop-
debug.js&2.7.0/build/container/container-debug.js&2.7.0/build/menu/
menu-debug.js&2.7.0/build/button/button-debug.js&2.7.0/build/calendar/
calendar-debug.js&2.7.0/build/json/json-debug.js&2.7.0/build/charts/
charts-debug.js&2.7.0/build/paginator/paginator-debug.js&2.7.0/build/
datatable/datatable-debug.js&2.7.0/build/get/get-debug.js&2.7.0/build/
logger/logger-debug.js&2.7.0/build/selector/selector-debug.js&2.7.0/
build/slider/slider-debug.js&2.7.0/build/tabview/tabview-
debug.js&2.7.0/build/treeview/treeview-debug.js&2.7.0/build/uploader/
uploader.js Line: 1262"]
What do you see when you click on the error message to go to the line
number?

Looking at line 1262 (the line indicated in the error) shows the code
I provided in the first post. However, I looked at the stack at the
time of error, and it looks like it comes from a line in my code that
uses the YUI framework to handle the response to an ajax request that
occurs as the page is loading.

I loaded the linked file and went to line 1262 an saw:
| "args: " + args + ", " +
Offending Line: var sButton = new YAHOO.widget.Button
('startDateButton'); //Creates a YUI button for the calendar selector

The line seems pretty straight-forward. It then goes into YUI, running
a slew of anonymous functions. The last function to run before the
error is _setLabel, which appears to be part of the
YAHOO.widget.Button code (or possibly an extension of it, since it's
part of the YAHOO.extend() function; The problematic line there runs
this code: this._button.innerHTML = p_sLabel;
According to the stack, p_sLabel = '<img src="/images/calbtn.gif">',
which makes sense. It's the image we want as part of the button. I
know you can use an image in a YUI Button, because I've seen it done,
and it works most of the time on this page.

Is that any help?

Can you reproduce that with a simple html page and inline script, like:
aDiv.innerHTML = "<img src="/images/calbtn.gif">"

Does it happen with all images, or just that image request (with all
headers, cookie, etc).
 
S

Spizzat2

Can you reproduce that with a simple html page and inline script, like:
aDiv.innerHTML = "<img src="/images/calbtn.gif">"

Does it happen with all images, or just that image request (with all
headers, cookie, etc).

Sorry I'm slow to reply. I don't always think to check the thread.
I made a quick test case as you suggested, and there's no error there.
I suppose the next step is to start adding things to the test case
until I find the error. Unfortunately, that's not high on my priority
list right now. I'll get to it soon enough, I hope.

If you've got other suggestions, let me know.
 
G

Garrett Smith

Spizzat2 said:
Sorry I'm slow to reply. I don't always think to check the thread.
I made a quick test case as you suggested, and there's no error there.
I suppose the next step is to start adding things to the test case
until I find the error. Unfortunately, that's not high on my priority
list right now. I'll get to it soon enough, I hope.

You could either add things to the example with no error but that would
probably only be productive if you had a good guess as to the cause.

Apparently the guess that it might be the image resulted in no error.

If you don't have a good guess, then work on removing code that causes
the error.
If you've got other suggestions, let me know.
The cause of the problem can be discovered by removing things from the
document.

Now back to that Ant buildfile...
 
S

Spizzat2

Ok, I've narrowed it down to a reasonable test case. It appears to
come from the YAHOO.widget.Dialog object. If anyone can find something
wrong with my code, great. If not, that would be a bug that needs
fixing on either YUI or Firebug's end, right?
Anyway, the code for the test case is as follows:

<html>
<head>
<script type="text/javascript" src="http://yui.yahooapis.com/combo?
2.7.0/build/yahoo/yahoo-debug.js&2.7.0/build/event/event-
debug.js&2.7.0/build/connection/connection-debug.js&2.7.0/build/
datasource/datasource-debug.js&2.7.0/build/dom/dom-debug.js&2.7.0/
build/autocomplete/autocomplete-debug.js&2.7.0/build/element/element-
debug.js&2.7.0/build/dragdrop/dragdrop-debug.js&2.7.0/build/container/
container-debug.js&2.7.0/build/menu/menu-debug.js&2.7.0/build/button/
button-debug.js&2.7.0/build/calendar/calendar-debug.js&2.7.0/build/
json/json-debug.js&2.7.0/build/charts/charts-debug.js&2.7.0/build/
paginator/paginator-debug.js&2.7.0/build/datatable/datatable-
debug.js&2.7.0/build/get/get-debug.js&2.7.0/build/logger/logger-
debug.js&2.7.0/build/selector/selector-debug.js&2.7.0/build/slider/
slider-debug.js&2.7.0/build/tabview/tabview-debug.js&2.7.0/build/
treeview/treeview-debug.js&2.7.0/build/uploader/uploader.js"></script>
<script type='text/Javascript'>
function test(){
var aDiv = document.getElementById('tester');

//aDiv.innerHTML = '<img src="/images/calbtn.gif">' ;
//var oMenuButton5 = new YAHOO.widget.Button({ type: "menu", label:
'Menu', name: "mymenubutton", menu: {}, container: 'tester' });
var dialog = new YAHOO.widget.Dialog('calendarContainer', {
visible:false,
context:["show", "tl", "bl"],
buttons:[
{
text:"Reset",
handler: function(){},
isDefault:true
},
{
text:"Close",
handler: function(){}
}
],
draggable:false,
close:true
});
}
</script>
</head>
<body onload='test();'>
<div id='tester'> Loading...</div><div id='calendarContainer'></div>
</body>
</html>


Using the current version of firebug (1.4.5) and version 2.7 of YUI
(It also happens with 2.8.0; I haven't tried 3.0).
Any time I load the page with the DOM tab open in firebug, I get the
error described in the OP. If someone could tell me where the fault
lies, that would be great. Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,189
Members
46,735
Latest member
HikmatRamazanov

Latest Threads

Top