"matches": ["http://google.*/*"]
?
Wildcard for domain works in Greasemonkey scripts, see
http://github.com/greasemonkey/greasemonkey/blob/master/content/convert2RegExp.js#L45
Why Chrome can't do the same?
--
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.
On Feb 13, 2:40 am, Arne Roomann-Kurrik <kur...@chromium.org> wrote:
> Hi,
>
> The match patterns in Google Chrome are a bit different, see:http://code.google.com/chrome/extensions/match_patterns.htmlfor more
> information.
>
> What you probably want is something like http://*.google.com/*
>
> ~Arne
>
> On Fri, Feb 12, 2010 at 12:57 PM, Nikita Vasilyev <alter.el...@gmail.com>wrote:
>
>
>
> > I would like to run my extension on all google domains.
> > (It's
> >https://chrome.google.com/extensions/detail/fijobgpmmkilncagclaejpjlc...
> > actually).
> > Why I can not do
>
> > "matches": ["http://google.*/*"]
>
> > ?
>
> > Wildcard for domain works in Greasemonkey scripts, see
>
> >http://github.com/greasemonkey/greasemonkey/blob/master/content/conve...
>
> > Why Chrome can't do the same?
>
> > --
> > 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>
if (location.href.indexOf("http://google.") === 0) {
// do code here
}
You can also use a regular expression if you need more power:
if (/^http:\/\/google\.[^\/]+/.test(location.href)) {
// do code here
}
On Feb 12, 12:57 pm, Nikita Vasilyev <alter.el...@gmail.com> wrote:
> I would like to run my extension on all google domains.
> (It'shttps://chrome.google.com/extensions/detail/fijobgpmmkilncagclaejpjlc...
> actually).
> Why I can not do
>
> "matches": ["http://google.*/*"]
>
> ?
>
> Wildcard for domain works in Greasemonkey scripts, seehttp://github.com/greasemonkey/greasemonkey/blob/master/content/conve...
Unfortunately, this is not possible at the moment. There is, however,
a workaround; set the content script so it runs on every website, then
evaluate the URL with JavaScript:
if (location.href.indexOf("http://google.") === 0) {
// do code here
}
You can also use a regular expression if you need more power:
if (/^http:\/\/google\.[^\/]+/.test(location.href)) {
// do code here
}> (It'shttps://chrome.google.com/extensions/detail/fijobgpmmkilncagclaejpjlc...
On Feb 12, 12:57 pm, Nikita Vasilyev <alter.el...@gmail.com> wrote:
> I would like to run my extension on all google domains.
> Wildcard for domain works in Greasemonkey scripts, seehttp://github.com/greasemonkey/greasemonkey/blob/master/content/conve...
>
> Why Chrome can't do the same?
--
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.
I believe there was already a proposal about an OR syntax like this:
"matches": [ "http://google.(com|co.uk|net)/*" ]
> The reason is that this opens you up to being injected where you don't
> expect, which can lead to security problems. In your above code, it would
> run onhttp://google.phisher.orgfor example. Even if you changed your code
> to explicitly test for known registry-controlled domains (.com, .co.uk, .jp,
> etc.), you'd still have a problem in that most companies (including Google)
> don't actually own companyname.* for every RCD that's out there. Further,
> in the cases where the company doesn't own that domain, the domain is often
> being used for phishing/malware, etc. So the only way to do this is to know
> ahead of time the explicit list of RCDs that are controlled by the company,
> which can be a pain to figure out unfortunately.
Fair enough. My apologies for posting without understanding the
security issues.