How to check "Allow file access" automatically on extension install ?

7,409 views
Skip to first unread message

y(oYo)

unread,
Sep 21, 2011, 6:09:05 AM9/21/11
to Chromium-extensions
Hi !
I'm working on a Chrome extension that use mainly with file:// urls.

I have a content script that inject code in current page, so I must
tick the "Allow file access" checkbox on extension page.
My question is : How can I force this checkbox to be checked on
extension install ?
Is it possible ? (I guess no but who knows...)

I'm aware of the --disable-extensions-file-access-check switch, but it
is not a suitable solution.

Thanks a lot.

Boris Smus

unread,
Sep 21, 2011, 11:06:03 AM9/21/11
to y(oYo), Chromium-extensions
Sorry, but there's no way to override the file security policy for an extension since this would pose a security risk. However, speaking of command line flags, you might also be interested in --allow-file-access-from-files as well.

- Boris


--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To post to this group, send email to chromium-...@chromium.org.
To unsubscribe from this group, send email to chromium-extens...@chromium.org.
For more options, visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/?hl=en.


Chiuto

unread,
Sep 21, 2011, 9:17:35 PM9/21/11
to y(oYo), Chromium-extensions
as far as i know, you need to specify file access in as starting up chrome application with argument.


y(oYo)

unread,
Sep 22, 2011, 10:38:16 AM9/22/11
to Chromium-extensions
Thx for your awnsers.
I understand this policiy consideration, but I'm having a hard time
fixing my problem.

The --disable-extensions-file-access-check doesn't seem to work in my
case. Worse, the switch enables file url for all installed extensions,
which is really not suitable.

Maybe I've got a problem with my extension's design ?
To explain with few words, my extension uses a content script.
This content script can modify current page DOM.
I've got a popup that sends a message to a listener in my content
script.
When the content script receive the message (enable/disable), it
modify current page's DOM.

Problem is, first time I install my extension, I have to restart
Chrome to initialize properly my listener i.e. load my
contentScript.js).
This problem is ONLY with file:// urls, NOT http urls.

Any clue ?
Thanks.

On Sep 22, 3:17 am, Chiuto <s...@chiuto.com> wrote:
> as far as i know, you need to specify file access in as starting up chrome
> application with argument.
>
>
>
>
>
>
>
> On Wed, Sep 21, 2011 at 6:09 PM, y(oYo) <lioledin...@gmail.com> wrote:
> > Hi !
> > I'm working on a Chrome extension that use mainly with file:// urls.
>
> > I have a content script that inject code in current page, so I must
> > tick the "Allow file access" checkbox on extension page.
> > My question is : How can I force this checkbox to be checked on
> > extension install ?
> > Is it possible ? (I guess no but who knows...)
>
> > I'm aware of the --disable-extensions-file-access-check switch, but it
> > is not a suitable solution.
>
> > Thanks a lot.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Chromium-extensions" group.
> > To post to this group, send email to chromium-extensi...@chromium.org.
> > To unsubscribe from this group, send email to
> > chromium-extensions+unsubscr...@chromium.org.

Aar Bee

unread,
Sep 21, 2011, 11:35:22 AM9/21/11
to Chromium-extensions
Speaking of contents scripts, tell me if this is a crazy idea or
impossible:

Can you write contents script that matches on "chrome://extensions"
URL? I imagine user manually installs extensions by visiting this
page. When your extension is installed, the page is already opened. So
can contents scripts in your extension then kick in right after its
install, go ahead and turns on that checkmark?


On Sep 21, 8:06 pm, Boris Smus <s...@chromium.org> wrote:
> Sorry, but there's no way to override the file security policy for an
> extension since this would pose a security risk. However, speaking of
> command line flags, you might also be interested
> in --allow-file-access-from-files as well.
>
> - Boris
>
>
>
>
>
>
>
> On Wed, Sep 21, 2011 at 3:09 AM, y(oYo) <lioledin...@gmail.com> wrote:
> > Hi !
> > I'm working on a Chrome extension that use mainly with file:// urls.
>
> > I have a content script that inject code in current page, so I must
> > tick the "Allow file access" checkbox on extension page.
> > My question is : How can I force this checkbox to be checked on
> > extension install ?
> > Is it possible ? (I guess no but who knows...)
>
> > I'm aware of the --disable-extensions-file-access-check switch, but it
> > is not a suitable solution.
>
> > Thanks a lot.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Chromium-extensions" group.
> > To post to this group, send email to chromium-extensi...@chromium.org.
> > To unsubscribe from this group, send email to
> > chromium-extensions+unsubscr...@chromium.org.

Scott Fujan

unread,
Sep 22, 2011, 11:34:25 AM9/22/11
to Aar Bee, Chromium-extensions
No, content scripts cannot be added to chrome://

To post to this group, send email to chromium-...@chromium.org.
To unsubscribe from this group, send email to chromium-extens...@chromium.org.

Boris Smus

unread,
Sep 22, 2011, 11:36:36 AM9/22/11
to Aar Bee, Chromium-extensions
You also can't inject scripts into other extensions (chrome-extension://), special chrome:// urls, and https://chrome.google.com/webstore/

- Boris

To post to this group, send email to chromium-...@chromium.org.
To unsubscribe from this group, send email to chromium-extens...@chromium.org.

Mihai Parparita

unread,
Sep 22, 2011, 3:10:49 PM9/22/11
to y(oYo), Chromium-extensions
On Thu, Sep 22, 2011 at 7:38 AM, y(oYo) <liole...@gmail.com> wrote:
Problem is, first time I install my extension, I have to restart
Chrome to initialize properly my listener i.e. load my
contentScript.js).
This problem is ONLY with file:// urls, NOT http urls.

Do you mean that the "Allow access to file URLs" checkbox doesn't take effect until you restart Chrome?

Mihai

y(oYo)

unread,
Sep 22, 2011, 3:33:12 PM9/22/11
to Chromium-extensions
Well, I guess yes.
But as I said, only for "file://" urls, and for both extension's
install or upgrade.
If I close then restart Chrome, my content script is well loaded for
this kind of url pattern.
Also, if I open the chrome://extensions tab, then disable/enable
"allow file url" checkbox, sometimes it seems to works without
restarting Chrome.
Very weird Chrome's behavior :/

Many thanks for your help.

On Sep 22, 9:10 pm, Mihai Parparita <mih...@chromium.org> wrote:

alok gangrade

unread,
Feb 22, 2014, 1:56:46 PM2/22/14
to chromium-...@chromium.org
I am reach to the one blog when I am surfing on web. May be this will be help you can check it out here
Reply all
Reply to author
Forward
0 new messages