Status: Available
Owner: ----
CC: mpcompl...@chromium.org,  erik...@chromium.org,  rafa...@chromium.org
Labels: Type-Feature Pri-2 OS-All Area-Misc Size-Medium

New issue 18259 by a...@chromium.org: Match patterns are kinda lame
http://code.google.com/p/chromium/issues/detail?id=18259

Match patterns always seemed a bit overcomplex to me, and now that I've
been away from them for awhile I have an alternate idea.

In reality, people almost always use content scripts one of two ways:

a) Modify or interact with a particular site
b) Modify or interact with every site

In the case of a) it is very rare (I can't really even think of a case)
where the author wants to modify on the http:// pages and not https://.
It's also very rare to want to modify only file:// URLs.

With that in mind, I think we could simplify things by doing something
like:

content_scripts: [
   {
     "domain": "*.google.com",
     "pattern": "/some/glob.*",
     "regex": "/some/regex.*",
     "js": ["foo.js", "bar.js"],
     "css": ["foo.css", "bar.css"]
   }
]

Some notes:

- The domain matching would have the same behavior as we have currently: an
asterisks can match any subdomain or no subdomain at all. So in the
example, "http://google.com"; matches.

- Domains match all schemes (http, https, ftp).

- The domain "*" actually matches all allowed schemes, including file://.

- It would be easier to allow regex matching (a commonly requested
Greasemonkey feature).

- We don't really need the domain and match properties to support lists
since developers could just create more than one content script entry.


Thoughts? This is obviously low priority, but just something I wanted
feedback on.

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/group/chromium-bugs
-~----------~----~----~----~------~----~------~--~---

Reply via email to