mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
988 B
988 B
sidebar_label |
---|
Page.addScriptTag |
Page.addScriptTag() method
Adds a <script>
tag into the page with the desired URL or content.
Signature:
class Page {
addScriptTag(options: {
url?: string;
path?: string;
content?: string;
type?: string;
id?: string;
}): Promise<ElementHandle>;
}
Parameters
Parameter | Type | Description |
---|---|---|
options | { url?: string; path?: string; content?: string; type?: string; id?: string; } |
Returns:
Promise<ElementHandle>
Promise which resolves to the added tag when the script's onload fires or when the script content was injected into frame.
Remarks
Shortcut for page.mainFrame().addScriptTag(options).