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

FilePicker for non-chrome URLs?

17 views
Skip to first unread message

Craig McDaniel

unread,
Feb 22, 2013, 2:47:01 PM2/22/13
to
I work on a Xul application is primarily a GWT (Google Web Toolkit (html+js)) app loaded via chrome:// url. However, at certain points our GWT app sends the user to an http:// url. We would like to be able to support file downloads from certain non-chrome sites, but according to the documentation here ( https://developer.mozilla.org/en-US/docs/XUL/Tutorial/Open_and_Save_Dialogs ), the file picker only works from chrome URLs. Is there a way to bypass this restriction for certain http hosts?

allen...@gmail.com

unread,
Feb 23, 2013, 11:54:28 AM2/23/13
to
On Saturday, February 23, 2013 3:47:01 AM UTC+8, Craig McDaniel wrote:
> I work on a Xul application is primarily a GWT (Google Web Toolkit (html+js)) app loaded via chrome:// url. However, at certain points our GWT app sends the user to an http:// url. We would like to be able to support file downloads from certain non-chrome sites, but according to the documentation here ( https://developer.mozilla.org/en-US/docs/XUL/Tutorial/Open_and_Save_Dialogs ), the file picker only works from chrome URLs. Is there a way to bypass this restriction for certain http hosts?

Take a look at https://developer.mozilla.org/en-US/docs/Code_snippets/Interaction_between_privileged_and_non-privileged_pages

It allows triggering events in chrome from html.

Craig McDaniel

unread,
Feb 25, 2013, 9:25:54 AM2/25/13
to
I guess that under this scenario, I would have to get hold of the byte array for the download and manually create the file picker myself?

Craig McDaniel

unread,
Feb 25, 2013, 5:17:59 PM2/25/13
to
On Friday, February 22, 2013 2:47:01 PM UTC-5, Craig McDaniel wrote:
> I work on a Xul application is primarily a GWT (Google Web Toolkit (html+js)) app loaded via chrome:// url. However, at certain points our GWT app sends the user to an http:// url. We would like to be able to support file downloads from certain non-chrome sites, but according to the documentation here ( https://developer.mozilla.org/en-US/docs/XUL/Tutorial/Open_and_Save_Dialogs ), the file picker only works from chrome URLs. Is there a way to bypass this restriction for certain http hosts?

I finally had the time to work up a test app and it almost worked. Apparently the browser download component is what I needed, not the file picker. However, it then popped up an error message about the DTD for the component. Turns out it needed brand.dtd and brand.properties files. https://developer.mozilla.org/en-US/docs/XULRunner_tips#Branding
0 new messages