Permission for file protocol

446 views
Skip to first unread message

Nikita Vasilyev

unread,
Feb 26, 2010, 7:03:14 AM2/26/10
to Chromium-extensions
Extensions don't work with file protocol.

manifest.json:

"permissions": ["file://*/*"]

"Could not load extension from 'xxx/css-autoreload'. Invalid scheme
for 'permissions[0]'. Only 'http' and 'https' are allowed."

This is very unpleasant to extensions for web-developers, which run
mostly on file://localhost/

PhistucK

unread,
Feb 26, 2010, 7:09:57 AM2/26/10
to Nikita Vasilyev, Chromium-extensions
Try to remove the asterisk at the end of "file://*/*".

☆PhistucK



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


Nikita Vasilyev

unread,
Feb 26, 2010, 7:20:19 AM2/26/10
to Chromium-extensions
Nothing's changed. Google Chrome 5.0.335.0 dev.


On Feb 26, 3:09 pm, PhistucK <phist...@gmail.com> wrote:
> Try to remove the asterisk at the end of "file://*/*".
>
> ☆PhistucK
>

> On Fri, Feb 26, 2010 at 14:03, Nikita Vasilyev <alter.el...@gmail.com>wrote:
>
>
>
> > Extensions don't work with file protocol.
>
> > manifest.json:
>
> >    "permissions": ["file://*/*"]
>
> > "Could not load extension from 'xxx/css-autoreload'. Invalid scheme
> > for 'permissions[0]'. Only 'http' and 'https' are allowed."
>
> > This is very unpleasant to extensions for web-developers, which run
> > mostly on file://localhost/
>
> > --
> > 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<chromium-extensions%2Bunsubscr...@chromium.org>

PhistucK

unread,
Feb 26, 2010, 7:24:07 AM2/26/10
to Nikita Vasilyev, Chromium-extensions
Can you paste your entire manifest here?
What platform?

☆PhistucK


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

Nikita Vasilyev

unread,
Feb 26, 2010, 7:41:55 AM2/26/10
to Chromium-extensions
Google Chrome 5.0.335.0 dev on Mac and Google Chrome 5.0.322.2 beta on
Windows. Neither of them is worked.

{
"name": "CSS auto-reload",
"version": "1.0",
"description": "Reloads CSS every second without reloading whole
page. Web developper's best friend.",
"background_page": "background.html",
"browser_action": {
"default_icon": "icon.png",
"default_title": "Start reloading CSS"
},
"permissions": ["file://*/", "tabs"]
}

On Feb 26, 3:24 pm, PhistucK <phist...@gmail.com> wrote:
> Can you paste your entire manifest here?
> What platform?
>
> ☆PhistucK
>

> On Fri, Feb 26, 2010 at 14:20, Nikita Vasilyev <alter.el...@gmail.com>wrote:
>
>
>
> > Nothing's changed. Google Chrome 5.0.335.0 dev.
>
> > On Feb 26, 3:09 pm, PhistucK <phist...@gmail.com> wrote:
> > > Try to remove the asterisk at the end of "file://*/*".
>
> > > ☆PhistucK
>
> > > On Fri, Feb 26, 2010 at 14:03, Nikita Vasilyev <alter.el...@gmail.com
> > >wrote:
>
> > > > Extensions don't work with file protocol.
>
> > > > manifest.json:
>
> > > >    "permissions": ["file://*/*"]
>
> > > > "Could not load extension from 'xxx/css-autoreload'. Invalid scheme
> > > > for 'permissions[0]'. Only 'http' and 'https' are allowed."
>
> > > > This is very unpleasant to extensions for web-developers, which run
> > > > mostly on file://localhost/
>
> > > > --
> > > > 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<chromium-extensions%2Bunsubscr...@chromium.org>

> > <chromium-extensions%2Bunsubscr...@chromium.org<chromium-extensions%252Bunsubscr...@chromium.org>

PhistucK

unread,
Feb 26, 2010, 7:47:31 AM2/26/10
to Nikita Vasilyev, Aaron Boodman, Chromium-extensions
I guess it is something new. Maybe (a regression or a feature) since the file origin access permission change.
Is it a regression or a feature?

☆PhistucK


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

Christian

unread,
Feb 26, 2010, 9:40:58 AM2/26/10
to Chromium-extensions
Hello,

Star issue : http://code.google.com/p/chromium/issues/detail?id=31947


On Feb 26, 1:47 pm, PhistucK <phist...@gmail.com> wrote:
> I guess it is something new. Maybe (a regression or a feature) since the
> file origin access permission change.
> Is it a regression or a feature?
>
> ☆PhistucK
>

> > > > <chromium-extensions%2Bunsubscr...@chromium.org<chromium-extensions%252Bunsubscr...@chromium.org>
> > <chromium-extensions%252Bunsubscr...@chromium.org<chromium-extensions%25252Bunsubscr...@chromium.org>

brentlintner

unread,
Feb 26, 2010, 3:37:00 PM2/26/10
to Chromium-extensions
Hi Nikita,

Currently we use the file protocol fine with our extension that works
as expected.

Though our actual matches property looks like this: matches:
[ "http://*/*", "https://*/*", "file://*/*"]

I believe you are using the wrong option. Permissions is for external
sites that your extension may access. This is for content scripts and
is defined it as follows:

....

"permissions" : ["http://www.google.com"],
"content_scripts": [
{
"matches": [ "http://*/*", "https://*/*", "file://*/*"],
"js": ["controllers/common.js", "controllers/Insertion.js"],
"run_at": "document_start"
}
]

...

Be sure to check out the chrome extensions developer documentation for
more infomation. (http://code.google.com/chrome/extensions/
content_scripts.html)

Best of luck,

Brent

Nikita Vasilyev

unread,
Feb 26, 2010, 9:20:51 PM2/26/10
to Chromium-extensions
Actually, I'm talking about permissions, not matches. I'm trying to do
chrome.tabs.executeScript() from background page, but I've got just:

Error during tabs.executeScript: Cannot access contents of url
"file://localhost/Users/nikitavasilev/Sites/github/css_auto-reload/
index.html". Extension manifest must request permission to access this
host.

BTW, I was not aware about support file scheme for content scripts,
thanks!

brentlintner

unread,
Feb 27, 2010, 2:11:10 PM2/27/10
to Chromium-extensions
Ah, so it is me who is mistaken. :)

Glad my post at least helped somewhat in the end lol.

Reply all
Reply to author
Forward
0 new messages