Safari instance represents your extension outside of the web content; an instance of the class is accessible as
safari. The counterpart class to
Safari for scripts running within the web content is
- Safari Desktop 5.0+
- Safari Extensions JS
Adding and removing style sheets and scripts. Adding or removing a content style sheet applies to pages immediately. Adding or removing a content script applies only to pages opened or reloaded after the change is made. Removing a style sheet or a script that is in the
Info file removes it only from the current browser session.
Whitelists and blacklists. A content script or style sheet may specify a blacklist and a whitelist; both are optional. For a description of the pattern format, see The Extension Builder Interface. The script or style sheet will be applied to a page only in the following cases:
The whitelist and blacklist are both empty.
The whitelist is empty, and the page’s URL does not match anything on the blacklist.
The page’s URL matches a pattern on the whitelist, and the blacklist is empty.
The page’s URL matches a pattern on the whitelist and it does not match anything on the blacklist.