unknown-content-type usable with xulrunner?

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

unknown-content-type usable with xulrunner?

markluffel
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

_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: unknown-content-type usable with xulrunner?

Benjamin Smedberg
[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.

--BDS
_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: unknown-content-type usable with xulrunner?

Nickolay Ponomarev
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
_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: unknown-content-type usable with xulrunner?

markluffel
In reply to this post by Benjamin Smedberg
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.

_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: unknown-content-type usable with xulrunner?

Nickolay Ponomarev
On 12 Jul 2006 15:01:50 -0700, [hidden email]
<[hidden email]> wrote:

> 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?

Nickolay
_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: unknown-content-type usable with xulrunner?

Neil-4
In reply to this post by markluffel
Nickolay Ponomarev wrote:

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

Not more prefs missing from XULRunner? Sigh...

--
Warning: May contain traces of nuts.
_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: unknown-content-type usable with xulrunner?

Marco Balestra
In reply to this post by markluffel
<[hidden email]> wrote:

> 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.

An exception is generated:

        XML Parsing Error: undefined entity Location:
        chrome://mozapps/content/downloads/unknownContentType.xul

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.

My solution:

1) get firefox's chrome/en-US.jar/branding folder
2) copy it inside xulrunner's chrome/en-US.jar
3) add the related line to xulrunner's chrome/en-US.manifest file
4) repeat steps 1-3 on every platform :-)

I don't know if such folders was missing because of an error or if it
has been intentionally kept out, in any case now "save as" dialogs are
working fine (and I'm safe =:-P)

HTH
--
Fletto i muscoli e sono nel vuoto
_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: unknown-content-type usable with xulrunner?

Benjamin Smedberg
Marco Balestra wrote:

> My solution:
>
> 1) get firefox's chrome/en-US.jar/branding folder
> 2) copy it inside xulrunner's chrome/en-US.jar

The XULRunner application itself should be providing the branding package,
not XULRunner. Please add an appropriate branding package to your application.

http://developer.mozilla.org/en/docs/XULRunner_tips#Branding

--BDS
_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: unknown-content-type usable with xulrunner?

Marco Balestra
Benjamin Smedberg <[hidden email]> wrote:

> The XULRunner application itself should be providing the branding package,
> not XULRunner. Please add an appropriate branding package to your application.

I see, thanks for your reply.

My concern is then related to the necessity of such package also for
"basic" actions, like a file download.
--
Fletto i muscoli e sono nel vuoto
_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: unknown-content-type usable with xulrunner?

craig.anslow
Hi

I am having a problem just trying to download a .exe file using Mozilla
Firefox, version 1.5.0.7 on NetBSD. I am not sure what other file
formats it does not work on. However it works on .doc and .pdf

This is the error I get:

XML Parsing Error: not well-formed
Location: chrome://mozapps/content/downloads/unknownContentType.xul
Line Number 1, Column 1:{
^

can someone please provide a solution?

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?

Cheers Craig

_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: unknown-content-type usable with xulrunner?

kamron
In reply to this post by markluffel
On Tuesday, July 11, 2006 6:04:37 PM UTC-4, [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?
>
> (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.

Ken
_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: unknown-content-type usable with xulrunner?

jens.ansorg
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



Hi, I run into this

XML Parsing Error: undefined entity
Location: chrome://mozapps/content/downloads/unknownContentType.xul
Line Number 30, Column 18:

with a current xulrunner (version 28) based application following an approach similar to the myBrowser in https://github.com/matthewkastor/XULRunner-Examples.

My Xul window just contains a <browser> that loads a fixed url. This page then contains links that download an executable. And here I get the error (instead of the download dialog window)

All the hints given seem to be for old versions of xulrunner that were packaged differently? I.e. there is no "content" folder in the xulrunner package and no en-us.jar or anything like that.

I have
/ (application.ini, chrome.manifest, stub.exe)
   /xulrunner    
   /defaults/preferences/prefs.js
   /chrome
        /content (my xul and js files)
        /icons   (app icon)
        /locale  
             /en-US (my app dtd)

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?

thanks, Jens

_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul
Loading...