← Back to CSS domain
CSS.createStyleSheet
Creates a new special "via-inspector" stylesheet in the frame with given `frameId`.
Domain: CSS
experimental
Parameters
| Name | Type | Description |
frameId | Page.FrameId | Identifier of the frame where "via-inspector" stylesheet should be created. |
force (optional) | boolean | If true, creates a new stylesheet for every call. If false,
returns a stylesheet previously created by a call with force=false
for the frame's document if it exists or creates a new stylesheet
(default: false). |
Returns
| Name | Type | Description |
styleSheetId | DOM.StyleSheetId | Identifier of the created "via-inspector" stylesheet. |
Example Request
{
"id": 1,
"method": "CSS.createStyleSheet",
"params": {
"frameId": "ABC123DEF456"
}
}
Example Response
{
"id": 1,
"result": {
"styleSheetId": "styleSheetId-value"
}
}
Usage in Node.js
const result = await send('CSS.createStyleSheet', {"frameId": "ABC123DEF456"});
console.log(result);
// {"styleSheetId": "styleSheetId-value"}