document.write doesn't trigger shouldLoad()

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

document.write doesn't trigger shouldLoad()

Michael Vincent van Rantwijk
First of all, I looked in bugzilla for this bug, but I didn't find one.
I might have overlooked one so in that case sorry guys.

Now, more and more people start to use document.write() for flash ads
but the problem is that document.write() doesn't trigger shouldLoad()
and that is becoming a huge problem these days, so I would like someone
to have a look at this problem.

Also, I noticed that there's no SeaMonkey product, so what should I use
to search bugzilla for bugs in SeaMonkey?

Thank you,
Michael
_______________________________________________
mozilla-dom mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-dom
Reply | Threaded
Open this post in threaded view
|

Re: document.write doesn't trigger shouldLoad()

Boris Zbarsky
Michael Vincent van Rantwijk wrote:
> Now, more and more people start to use document.write() for flash ads
> but the problem is that document.write() doesn't trigger shouldLoad()

Clarify, please?  Content written out via document.write() should trigger
shouldLoad().  Or did I misunderstand your situation?

> Also, I noticed that there's no SeaMonkey product, so what should I use
> to search bugzilla for bugs in SeaMonkey?

"Mozilla Application Suite"

-Boris
_______________________________________________
mozilla-dom mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-dom
Reply | Threaded
Open this post in threaded view
|

Re: document.write doesn't trigger shouldLoad()

Michael Vincent van Rantwijk
Boris Zbarsky wrote:
> Michael Vincent van Rantwijk wrote:
>> Now, more and more people start to use document.write() for flash ads
>> but the problem is that document.write() doesn't trigger shouldLoad()
>
> Clarify, please?  Content written out via document.write() should
> trigger shouldLoad().  Or did I misunderstand your situation?

Correct, that fails to work in SeaMonkey because objects inserted into
the DOM don't trigger shouldLoad()

I've add a dump to the shouldLoad() in my component (remember that
testcase?) and there's no output when I visit: http://home.netscape.com 
They use a JavaScript snippet to insert an object from
download.macromedia.com (just load that page and you will find out for
yourself)

>> Also, I noticed that there's no SeaMonkey product, so what should I
>> use to search bugzilla for bugs in SeaMonkey?
>
> "Mozilla Application Suite"

Ok, thank you Boris.

Michael
_______________________________________________
mozilla-dom mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-dom
Reply | Threaded
Open this post in threaded view
|

Re: document.write doesn't trigger shouldLoad()

Boris Zbarsky
Michael Vincent van Rantwijk wrote:
>> Clarify, please?  Content written out via document.write() should
>> trigger shouldLoad().  Or did I misunderstand your situation?
>
> Correct, that fails to work in SeaMonkey because objects inserted into
> the DOM don't trigger shouldLoad()

They sure do over here.  Please point me to a testcase that shows the bug you're
claiming.

> I've add a dump to the shouldLoad() in my component

Are you still not using XPCNativeWrapper?

And again, this all worksforme.

-Boris
_______________________________________________
mozilla-dom mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-dom
Reply | Threaded
Open this post in threaded view
|

Re: document.write doesn't trigger shouldLoad()

Michael Vincent van Rantwijk
Boris Zbarsky wrote:

> Michael Vincent van Rantwijk wrote:
>>> Clarify, please?  Content written out via document.write() should
>>> trigger shouldLoad().  Or did I misunderstand your situation?
>>
>> Correct, that fails to work in SeaMonkey because objects inserted into
>> the DOM don't trigger shouldLoad()
>
> They sure do over here.  Please point me to a testcase that shows the
> bug you're claiming.
>
>> I've add a dump to the shouldLoad() in my component
>
> Are you still not using XPCNativeWrapper?

We sure do.

> And again, this all worksforme.

I found the cause of this bug in this code:

try {

var usersResponse = promptService.confirmEx(aWindow, title,
confirmationMsg, (promptService.BUTTON_POS_0 *
promptService.BUTTON_TITLE_IS_STRING) + (promptService.BUTTON_POS_1 *
promptService.BUTTON_TITLE_IS_STRING),
                 "Allow", "Block", null, checkboxText, checkbox);

} catch(ex) { dump("\nex: " + ex); }

because it dumps the following text on the console:

ex: ReferenceError: gotoFeature is not defined

Nowhere in our code we use/call anything called 'gotoFeature' and it
even dumps that when MultiZilla is disabled.

Michael
_______________________________________________
mozilla-dom mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-dom
Reply | Threaded
Open this post in threaded view
|

Re: document.write doesn't trigger shouldLoad()

Boris Zbarsky
Michael Vincent van Rantwijk wrote:
> because it dumps the following text on the console:
>
> ex: ReferenceError: gotoFeature is not defined

Is gotoFeature used by the page?

And what is this prompt, exactly?  Are you posing a dialog from inside a
ShouldLoad call?  That's a _really_ good way to crash (this is why the old "ask
for permission to load image" dialog in mozilla was backed out).

-Boris
_______________________________________________
mozilla-dom mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-dom
Reply | Threaded
Open this post in threaded view
|

Re: document.write doesn't trigger shouldLoad()

Michael Vincent van Rantwijk
Boris Zbarsky wrote:
> Michael Vincent van Rantwijk wrote:
>> because it dumps the following text on the console:
>>
>> ex: ReferenceError: gotoFeature is not defined
>
> Is gotoFeature used by the page?

Ah, yes it is.

> And what is this prompt, exactly?  Are you posing a dialog from inside a
> ShouldLoad call?  That's a _really_ good way to crash (this is why the
> old "ask for permission to load image" dialog in mozilla was backed out).

Yes, but we use that prompt for over three years now, and I have never
had any troubles with it.

Michael
_______________________________________________
mozilla-dom mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-dom
Reply | Threaded
Open this post in threaded view
|

Re: document.write doesn't trigger shouldLoad()

Michael Vincent van Rantwijk
Michael Vincent van Rantwijk wrote:
> Boris Zbarsky wrote:
>> Michael Vincent van Rantwijk wrote:
>>> because it dumps the following text on the console:
>>>
>>> ex: ReferenceError: gotoFeature is not defined
>>
>> Is gotoFeature used by the page?
>
> Ah, yes it is.

Isn't that a little odd? I mean, should errors from that web page end up
into out component?

Michael
_______________________________________________
mozilla-dom mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-dom
Reply | Threaded
Open this post in threaded view
|

Re: document.write doesn't trigger shouldLoad()

Boris Zbarsky
In reply to this post by Michael Vincent van Rantwijk
Michael Vincent van Rantwijk wrote:
>> And what is this prompt, exactly?  Are you posing a dialog from inside
>> a ShouldLoad call?  That's a _really_ good way to crash (this is why
>> the old "ask for permission to load image" dialog in mozilla was
>> backed out).
>
> Yes, but we use that prompt for over three years now, and I have never
> had any troubles with it.

Fine, but don't complain when things break, in that case.  What you're doing is
not supported and not designed for.

-Boris
_______________________________________________
mozilla-dom mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-dom
Reply | Threaded
Open this post in threaded view
|

Re: document.write doesn't trigger shouldLoad()

Boris Zbarsky
In reply to this post by Michael Vincent van Rantwijk
Michael Vincent van Rantwijk wrote:
> Isn't that a little odd? I mean, should errors from that web page end up
> into out component?

Does seem odd, yes.  I suspect the page runs JS while your dialog is up so that
an exception is set on th JS context... or something.  It still shouldn't
happen, but we'd need something resembling a testcase to get to the bottom of it.

-Boris
_______________________________________________
mozilla-dom mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-dom
Reply | Threaded
Open this post in threaded view
|

Re: document.write doesn't trigger shouldLoad()

Michael Vincent van Rantwijk
Boris Zbarsky wrote:
> Michael Vincent van Rantwijk wrote:
>> Isn't that a little odd? I mean, should errors from that web page end
>> up into out component?
>
> Does seem odd, yes.  I suspect the page runs JS while your dialog is up
> so that an exception is set on th JS context... or something.  It still
> shouldn't happen, but we'd need something resembling a testcase to get
> to the bottom of it.

I had a hard drive crash two weeks ago so I had to replace it and
re-install everything again, but it turns our that component was missing
a space somewhere in the source code (var _event instead var _event) and
adding it back in solved this problem.

Michael
_______________________________________________
mozilla-dom mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-dom