unknown-content-type usable with xulrunner?

unknown-content-type usable with xulrunner?

I'm trying to download a PDF through a <browser> in XulRunner, but have
trouble at the step when the unknownContentType.xul dialog is loaded. I
followed the advice at:
http://developer.mozilla.org/en/docs/XULRunner_tips#Brandingwhich finds the missing entities, but now I'm stuck on a javascript
error in the window (says variable "dialog" is not defined).

Is this supposed to work "out-of-the-box"?

Also, isn't the "dialog" variable essentially like the "window"
variable in HTML javascript? Why would that not be defined?

Re: unknown-content-type usable with xulrunner?

> I'm trying to download a PDF through a <browser> in XulRunner, but have
> trouble at the step when the unknownContentType.xul dialog is loaded. I
> followed the advice at:
> http://developer.mozilla.org/en/docs/XULRunner_tips#Branding> which finds the missing entities, but now I'm stuck on a javascript
> error in the window (says variable "dialog" is not defined).
>
> Is this supposed to work "out-of-the-box"?
>
> Also, isn't the "dialog" variable essentially like the "window"
> variable in HTML javascript? Why would that not be defined?

Can you put a testcase app up on the web? I'm not sure that the "dialog"
variable is like the "window" builtin... but I'd have to look at the code in
question.

Re: unknown-content-type usable with xulrunner?

> [hidden email] wrote:
> > I'm trying to download a PDF through a <browser> in XulRunner, but have
> > trouble at the step when the unknownContentType.xul dialog is loaded. I
> > followed the advice at:
> > http://developer.mozilla.org/en/docs/XULRunner_tips#Branding> > which finds the missing entities, but now I'm stuck on a javascript
> > error in the window (says variable "dialog" is not defined).
> >
> > Is this supposed to work "out-of-the-box"?
> >
> > Also, isn't the "dialog" variable essentially like the "window"
> > variable in HTML javascript? Why would that not be defined?
>
> Can you put a testcase app up on the web? I'm not sure that the "dialog"
> variable is like the "window" builtin... but I'd have to look at the code in
> question.
>

IIRC, |dialog| is a reference to the nsUnknownContentTypeDialog JS
XPCOM component (which is set up in the component's code when the
window is opened). I suggest that you file a bug with the exact error
message you get.

Re: unknown-content-type usable with xulrunner?

> On 7/12/06, Benjamin Smedberg <[hidden email]> wrote:
> > [hidden email] wrote:
> > > I'm trying to download a PDF through a <browser> in XulRunner, but have
> > > trouble at the step when the unknownContentType.xul dialog is loaded. I
> > > followed the advice at:
> > > http://developer.mozilla.org/en/docs/XULRunner_tips#Branding> > > which finds the missing entities, but now I'm stuck on a javascript
> > > error in the window (says variable "dialog" is not defined).
> > >
> > > Is this supposed to work "out-of-the-box"?
> > >
> > > Also, isn't the "dialog" variable essentially like the "window"
> > > variable in HTML javascript? Why would that not be defined?
> >
> > Can you put a testcase app up on the web? I'm not sure that the "dialog"
> > variable is like the "window" builtin... but I'd have to look at the code in
> > question.
> >
>
> IIRC, |dialog| is a reference to the nsUnknownContentTypeDialog JS
> XPCOM component (which is set up in the component's code when the
> window is opened). I suggest that you file a bug with the exact error
> message you get.
>
> Nickolay

Thanks for the replies, you guys are right that the "dialog" var is not
like "window", but is a nsUnknownContentTypeDialog.
After more debugging I found that it was choking on missing
preferences, so I added the firefox.js prefs (minus a few that looked
like they might conflict). This made the unknownContentType dialog work
in a test app.

Re: unknown-content-type usable with xulrunner?

> Nickolay Ponomarev wrote:
> > On 7/12/06, Benjamin Smedberg <[hidden email]> wrote:
> > > [hidden email] wrote:
> > > > I'm trying to download a PDF through a <browser> in XulRunner, but have
> > > > trouble at the step when the unknownContentType.xul dialog is loaded. I
> > > > followed the advice at:
> > > > http://developer.mozilla.org/en/docs/XULRunner_tips#Branding> > > > which finds the missing entities, but now I'm stuck on a javascript
> > > > error in the window (says variable "dialog" is not defined).
> > > >
> > > > Is this supposed to work "out-of-the-box"?
> > > >
> > > > Also, isn't the "dialog" variable essentially like the "window"
> > > > variable in HTML javascript? Why would that not be defined?
> > >
> > > Can you put a testcase app up on the web? I'm not sure that the "dialog"
> > > variable is like the "window" builtin... but I'd have to look at the code in
> > > question.
> > >
> >
> > IIRC, |dialog| is a reference to the nsUnknownContentTypeDialog JS
> > XPCOM component (which is set up in the component's code when the
> > window is opened). I suggest that you file a bug with the exact error
> > message you get.
> >
> > Nickolay
>
> Thanks for the replies, you guys are right that the "dialog" var is not
> like "window", but is a nsUnknownContentTypeDialog.
> After more debugging I found that it was choking on missing
> preferences, so I added the firefox.js prefs (minus a few that looked
> like they might conflict). This made the unknownContentType dialog work
> in a test app.
>

Could you add the list of required by nsUnknownContentTypeDialog prefs
to the devmo article?

Re: unknown-content-type usable with xulrunner?

> After more debugging I found that it was choking on missing
> preferences, so I added the firefox.js prefs (minus a few that looked
> like they might conflict). This made the unknownContentType dialog work
> in a test app.

I have been experiencing the same exact problem in a test app
(standalone app tested both in Linux and Mac OS X with 1.8.04)...

It's easy to reproduce the problem: load in a XUL browser object
something not directly handled by it, like a simple word document.
I did it using browser's loadURI() method.

I found a missing DTD for "branding", one of the two DTDs required by
"unknownContentType.xul".
This missing DTD is *not* the one storing the missing entity, by the way
I suppose that the whole entity declaration becomes invalid.

I looked at editing the XUL.mfasl but this is does not appear to be the
right file plus I can bearly read it as it appears to be binary like. I
have basically used the browser straight out of the box. I do not have
control to administer the network.

This is completely frustrating as I have to use another browser to
download stuff in. Does anyone have any ideas?

Re: unknown-content-type usable with xulrunner?

> I'm trying to download a PDF through a <browser> in XulRunner, but have
> trouble at the step when the unknownContentType.xul dialog is loaded. I
> followed the advice at:
> http://developer.mozilla.org/en/docs/XULRunner_tips#Branding> which finds the missing entities, but now I'm stuck on a javascript
> error in the window (says variable "dialog" is not defined).
>
> Is this supposed to work "out-of-the-box"?
>
> Also, isn't the "dialog" variable essentially like the "window"
> variable in HTML javascript? Why would that not be defined?
>
> (Using xulrunner 1.8.0.1 on Windows XP Pro)
>
> Thanks
> --Mark

I have stumbled upon this feature. And yes, it does work "out-of-the-box", it just takes a bit of digging. Since I agree that the "solution" to the branding issue described was a bit sketchy, I have documented the steps that worked for me at: ==> https://sites.google.com/a/digital-parts.com/xul-unknowncontent/home .
I haven't tested the steps, though, so if you find anything that needs correcting, let me know.

Re: unknown-content-type usable with xulrunner?

Am Freitag, 8. März 2013 01:27:55 UTC+1 schrieb [hidden email]:
>
> I have stumbled upon this feature. And yes, it does work "out-of-the-box", it just takes a bit of digging. Since I agree that the "solution" to the branding issue described was a bit sketchy, I have documented the steps that worked for me at: ==> https://sites.google.com/a/digital-parts.com/xul-unknowncontent/home .
>
> I haven't tested the steps, though, so if you find anything that needs correcting, let me know.
>
>
>
> Ken

If I extract stuff from the firefox omni.ja (DTDs containing the missing entities), where would I need to put them and how to reference them in the manifest? Or how else to include the necessary files?