userScripts.RegisteredUserScript
An object representing registered user scripts. Returned by userScripts.getScripts() and used as input to userScripts.register() and userScripts.update().
An object representing registered user scripts. Returned by userScripts.getScripts() and used as input to userScripts.register() and userScripts.update().
Type
Values of this type are an object containing these properties:
allFrames- :
boolean. IfallFramesistrue, the script is injected into all of a page's frames. By default, it'sfalseand the script is only injected into the top frame. id- :
string. The ID of a user script. This property must not start with a '_', which is reserved as a prefix for generated script IDs. jsfor userScripts.update() calls, required for userScripts.register()- :
arrayof userScripts.ScriptSource. The scripts to inject into matching pages. matches- :
arrayofstring. Match patterns for the pages to run the script in.matchesorincludeGlobsmust be specified in userScripts.register() calls. excludeMatches- :
arrayofstring. Match patterns for pages that the script must not be run in. includeGlobs- :
string. Glob patterns for the pages to run the script in.matchesorincludeGlobsmust be specified in userScripts.register() calls. excludeGlobs- :
string. Glob patterns for pages that the script must not be run in. runAt- : extensionTypes.RunAt. The earliest the script is injected into a tab. Defaults to
"document_idle". world- : userScripts.ExecutionWorld. The execution environment to use to run the scripts. Defaults to
"USER_SCRIPT". worldId- :
string. ID of a user script world the script executes in. Only valid ifworldisUSER_SCRIPTor omitted. IfworldIdis omitted, the script is executed in the defaultUSER_SCRIPTworld (""). Values with leading underscores (_) are reserved. The maximum length is 256 characters. A world can be used by several scripts as their execution environment. To configure the behavior of a world, pass itsworldIdto userScripts.configureWorld before the first script executes in that world.