Confirmed users
161
edits
(→API Methods: replace scriptMod.enable/disable with global add/remove, make add() explicit [8:a204bab6d64d]) |
(→Discussion - format for include: link & summarize to discussion related to 'include') |
||
Line 102: | Line 102: | ||
Extracted from [http://groups.google.com/group/mozilla-labs-jetpack/browse_thread/thread/09deffcc11fa00ea/2ce4c1ed979cb8da this thread]. | Extracted from [http://groups.google.com/group/mozilla-labs-jetpack/browse_thread/thread/09deffcc11fa00ea/2ce4c1ed979cb8da this thread]. | ||
==== Discussion - | ==== Discussion - <code>include</code> option ==== | ||
A short survey of existing formats: | |||
* [http://wiki.greasespot.net/Include_and_exclude_rules Greasemonkey scripts] specify include and exclude URLs, each may contain wildcards ("*") in any location and may use a special ".tld" domain. These rules get compiled to a regular expression (see [http://github.com/greasemonkey/greasemonkey/blob/master/content/convert2RegExp.js convert2RegExp]), which is then matched against every URL loaded in the browser. | * [http://wiki.greasespot.net/Include_and_exclude_rules Greasemonkey scripts] specify include and exclude URLs, each may contain wildcards ("*") in any location and may use a special ".tld" domain. These rules get compiled to a regular expression (see [http://github.com/greasemonkey/greasemonkey/blob/master/content/convert2RegExp.js convert2RegExp]), which is then matched against every URL loaded in the browser. | ||
* [http://code.google.com/chrome/extensions/match_patterns.html Match patterns for Google Chrome's content scripts] are similar to Greasemonkey's, but force to specify domain (either fully, any domain, or <code>*.domain</code>) and don't have the magic tld domain. | * [http://code.google.com/chrome/extensions/match_patterns.html Match patterns for Google Chrome's content scripts] are similar to Greasemonkey's, but force to specify domain (either fully, any domain, or <code>*.domain</code>) and don't have the magic tld domain. | ||
Line 109: | Line 109: | ||
* When specifying CSS styling [https://developer.mozilla.org/en/Using_the_Stylesheet_Service Using the Stylesheet Service], which is an easy and robust way to apply CSS to all content and is also what Stylish uses, you have to describe the filters using CSS, i.e. [https://developer.mozilla.org/index.php?title=En/CSS/%40-moz-document @-moz-document] rule. It allows to specify domain, exact URL, or the URL prefix. | * When specifying CSS styling [https://developer.mozilla.org/en/Using_the_Stylesheet_Service Using the Stylesheet Service], which is an easy and robust way to apply CSS to all content and is also what Stylish uses, you have to describe the filters using CSS, i.e. [https://developer.mozilla.org/index.php?title=En/CSS/%40-moz-document @-moz-document] rule. It allows to specify domain, exact URL, or the URL prefix. | ||
[http://groups.google.com/group/mozilla-labs-jetpack/msg/decd886a1ae37018 Myk' | Comments: [http://groups.google.com/group/mozilla-labs-jetpack/msg/decd886a1ae37018 Myk #1] [http://groups.google.com/group/mozilla-labs-jetpack/msg/bd83ab801443a05b Myk #2] [http://groups.google.com/group/mozilla-labs-jetpack/msg/5cd0089d3795853e Brian] | ||
The 'include' option is made required to make the mods clearly specify which pages they apply to (for easier auditing). | |||
It was suggested to restrict the schemes of URLs page mods can run on, since letting a page mod run on chrome://, for example, can have security consequences we have not thought through. | |||
==== Discussion - e10s ==== | ==== Discussion - e10s ==== |