Skip to content

API > wxt/client > injectScript

Function: injectScript()

injectScript(path, options?): Promise<void>

This function can only be called inside content scripts.

Inject an unlisted script into the page. Scripts are added to the <head> element or document.documentElement if there is no head.

Make sure to add the injected script to your manifest's web_accessible_resources.

Parameters

path: any

options?: InjectScriptOptions

Source

packages/wxt/src/client/inject-script.ts:18


Generated using typedoc-plugin-markdown and TypeDoc