Skip to content

Commit e5e1813

Browse files
committed
Readme fix
1 parent a7721fa commit e5e1813

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Chrome Extension Content Script Tools
1+
# Chrome Extension Content Script Tools
22

33
The Chrome Extension APIs for interacting with tabs are great, but fall short on providing advanced tracking of tab state, change, and convenient event binding/listeners. Additionally, working with content scripts in a dynamic manner is possible but not as easy or convenient as would be ideal.
44

@@ -16,7 +16,7 @@ Internally, the script keeps a reference of the full set of tabs open in the bro
1616
API
1717
------
1818

19-
###.addTabChangedCallback( types, callback )
19+
### .addTabChangedCallback( types, callback )
2020
> This function allows you to bind a listener to change events on all tabs in the browser, including specificity for the change types you wish to listen for
2121
2222
> `types` _(string or array of strings)_ specific change events you wish to bind the listener to. Options include "_load_", "_close_", "_reload_", and "_hash_change_"
@@ -31,7 +31,7 @@ API
3131
> ```
3232
3333
34-
###.registerContentResourcesForTabUrls( matches, scripts, stylesheets, callback, namespace )
34+
### .registerContentResourcesForTabUrls( matches, scripts, stylesheets, callback, namespace )
3535
> This function allows you to setup advanced rules for loading resources (scripts & stylesheets) on a tab page, including callback functionality and namespace binding. You setup a group of resources and a set of matches for when those resources should be included on the page, with a callback function that's called when all resources are loaded.
3636
3737
> `matches` _(string, regex, function, or array of these) match conditions for determining if the resources should be loaded on the page. These can include simple strings that are matched to see if they are present in the tab URL, regexes that can match agains the tab URL, or functions that take a single parameter (tab) and return a boolean to determine if they resources should be loaded. You can mix/match these as needed for your use case. _NOTE_ that if an array of matches is provided, only 1 needs to return `true` for the content resources to be loaded.
@@ -69,7 +69,7 @@ API
6969
> );
7070
>```
7171
72-
###.unregisterContentResourcesByNamespace( namespace )
72+
### .unregisterContentResourcesByNamespace( namespace )
7373
> Unbind existing listeners bound with _registerContentResourcesForTabUrls_
7474
7575
> `namespace` _(string)_ namespace for listeners that wish to unbind
@@ -79,7 +79,7 @@ API
7979
> CONTENT_SCRIPT_TOOLS.unregisterContentResourcesByNamespace( "https_actions" );
8080
> ```
8181
82-
###.executeExitingTabLoadMatches( namespace )
82+
### .executeExitingTabLoadMatches( namespace )
8383
> Execute contente resource watchers bound with _registerContentResourcesForTabUrls_ on existing tabs. This is needed because matches for the listeners are only evaluated on tab load/reload, so if you want your extensions functionality to work on existing pages right at install time you need to bind the watchers you want, then call this function.
8484
8585
> `namespace` _(string, optional)_ namespace of specific watchers you want to match
@@ -92,7 +92,7 @@ API
9292
> CONTENT_SCRIPT_TOOLS.executeExitingTabLoadMatches();
9393
> ```
9494
95-
###.loadContentScriptsInTab( scripts, tab_or_id, callback, run_at_doc_start, all_frames )
95+
### .loadContentScriptsInTab( scripts, tab_or_id, callback, run_at_doc_start, all_frames )
9696
> This function allows you to load multiple scrips in an existing tab with various options. Under the hood it leverages [chrome.tabs.executeScript](https://developer.chrome.com/extensions/tabs#method-executeScript) but provides advanced functionality including callbacks.
9797
9898
> `scripts` _(string or array of strings)_ scripts you wish to load in the tab. _NOTE_ that these should be URLs relative to the extension root dir (and should all start with a leading slash). Also, array ordering is respected when the scripts are loaded on the page.
@@ -127,7 +127,7 @@ API
127127
> );
128128
> ```
129129
130-
###.loadContentStylesheetsInTab( stylesheets, tab_or_id )
130+
### .loadContentStylesheetsInTab( stylesheets, tab_or_id )
131131
> This function loads stylesheet(s) into a specified tab.
132132
133133
> `stylesheets` _(string or array of strings)_ stylesheets you wish to load in the tab. _NOTE_ that these should be URLs relative to the extension root dir (and should all start with a leading slash). Also, array ordering is respected when the stylesheets are loaded on the page.

0 commit comments

Comments
 (0)