Labs/Jetpack/Reboot/JEP/108: Difference between revisions

Jump to navigation Jump to search
Line 40: Line 40:


#<b>options</b> - (<i>object</i>)
#<b>options</b> - (<i>object</i>)
#* matches: (<i>array</i>) an array of web site resource strings
#* bind: (<i>mixed</i>) a variable that will be bound as the 'this' keyword in the function
#* includes: (<i>object</i>) 'script' or 'style' keyed nodes whose values are arrays of asset resource strings
#* arguments: (<i>array > mixed</i>) an array of mixed variables passed as the function arguments
#* styles: (<i>object</i>) an object whose keys are CSS selectors and whose values are objects composed of CSS property keys and values
#* timeout: (<i>number</i>) a number that is used to set the timeout duration
#* script: (<i>function</i>) a function that will be injected into the page and called. By default, the function is bound with the target document's window object
#* interval: (<i>number</i>) a number that is used to set the interval duration
#<b>executable</b> - (<i>array</i>) an array of web site resource strings
#<b>action</b> - (<i>function</i>) a function to be executed within the DOM of the Background Page - by default, the Background Page's window object is the bound 'this' within the function


<b>Returns:</b>
<b>Returns:</b>


The Page Mods instance
<b>user defined return value</b> - The function's return value as specified by the user
 
or
 
<i>If timeout or interval options are used:</i>
 
<b>array</b> - an array whose first item is the function's user defined return value, and second is a variable the user can save to clear the timing event


<b>Notes:</b>
<b>Notes:</b>


Modifications passed to the Page Mods instance with this method will be added, and persist, on open and future documents matching all of the URL(s) currently on the 'matches' white-list.


<b>Examples:</b>
<b>Examples:</b>
1,273

edits

Navigation menu