User:Asqueella/JEP 107: Difference between revisions

Jump to navigation Jump to search
m
Line 55: Line 55:
**# <code><nowiki>http://example.com/test</nowiki></code> - the single specified URL
**# <code><nowiki>http://example.com/test</nowiki></code> - the single specified URL
* '''TBD:''' <code>filter</code> function instead of (or in addition) to <code>exclude</code>.
* '''TBD:''' <code>filter</code> function instead of (or in addition) to <code>exclude</code>.
* <code>script</code>:  
* <code>script</code>: an optional parameter specifying the code to run on the matched pages.
** No code is run if this parameter is not specified.
** Providing a single function <code>func</code> is equivalent to providing a single-item array <code>[func]</code>
** When the provided value is an array, its items are expected to be functions. Non-function values are ignored.
** The specified functions are called in order when a page matching the <code>include</code> rules starts to load (but before any content is loaded in the page -- i.e. when the <code>content-document-global-created</code> notification implemented in {{bug|549539}} is issued). An exception thrown from one of the functions does not stop the rest of functions from executing.
** The specified callbacks are called with a single <code>wrappedWindow</code> parameter -- the content's <code>window</code> object wrapped in an XPCNativeWrapper. The callback's <code>this</code> is the page mod object ('''TBD''' not currently implemented).


===== '''ISSUE:''' What format should be chosen for <code>include</code> rules? =====
===== '''ISSUE:''' What format should be chosen for <code>include</code> rules? =====
Line 72: Line 77:


This is how I've arrived at the format described above.
This is how I've arrived at the format described above.


==== <code>ScriptMod</code> APIs ====
==== <code>ScriptMod</code> APIs ====
Confirmed users
161

edits

Navigation menu