Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

unknown-content-type usable with xulrunner?

889 views
Skip to first unread message

markl...@gmail.com

unread,
Jul 11, 2006, 6:04:37 PM7/11/06
to
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

Benjamin Smedberg

unread,
Jul 12, 2006, 10:07:01 AM7/12/06
to

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

Nickolay Ponomarev

unread,
Jul 12, 2006, 11:01:32 AM7/12/06
to markl...@gmail.com, dev-te...@lists.mozilla.org

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

markl...@gmail.com

unread,
Jul 12, 2006, 6:01:50 PM7/12/06
to

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.

Nickolay Ponomarev

unread,
Jul 12, 2006, 7:07:47 PM7/12/06
to markl...@gmail.com, dev-te...@lists.mozilla.org
On 12 Jul 2006 15:01:50 -0700, markl...@gmail.com
Could you add the list of required by nsUnknownContentTypeDialog prefs
to the devmo article?

Nickolay

Neil

unread,
Jul 13, 2006, 6:04:03 AM7/13/06
to
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.

Marco Balestra

unread,
Sep 30, 2006, 11:42:29 AM9/30/06
to
<markl...@gmail.com> 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

Benjamin Smedberg

unread,
Sep 30, 2006, 3:26:49 PM9/30/06
to
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

Marco Balestra

unread,
Oct 1, 2006, 9:06:06 AM10/1/06
to
Benjamin Smedberg <benj...@smedbergs.us> 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.

craig....@gmail.com

unread,
Oct 15, 2006, 7:03:27 PM10/15/06
to
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

kam...@digital-parts.com

unread,
Mar 7, 2013, 7:27:55 PM3/7/13
to
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

jens....@gmail.com

unread,
Apr 9, 2014, 7:54:43 AM4/9/14
to
Am Freitag, 8. März 2013 01:27:55 UTC+1 schrieb kam...@digital-parts.com:
>
> 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

0 new messages