Path: blob/main/files/en-us/mozilla/add-ons/webextensions/api/scripting/injectiontarget/index.md
6552 views
------{{AddonSidebar()}}
This object contains details specifying the injection target for CSS and JavaScript. Its used in {{WebExtAPIRef("scripting.executeScript()")}}, {{WebExtAPIRef("scripting.insertCSS()")}}, and {{WebExtAPIRef("scripting.removeCSS()")}}.
Type
Values of this type are objects. They contain these properties:
allFrames{{optional_inline}}:
boolean. Whether the script or CSS is injected into all frames within the tab. Defaults tofalse. Cannot betrueifframeIdsis specified.
frameIds{{optional_inline}}:
arrayofnumber. Array of the IDs of the frames to inject into.
tabId:
number. The ID of the tab to inject into.
Browser compatibility
{{Compat}}
{{WebExtExamples}}
Note: This API is based on Chromium's
chrome.scriptingAPI.