← Back to CSS domain

CSS.createStyleSheet

Creates a new special "via-inspector" stylesheet in the frame with given `frameId`.

Domain: CSS experimental

Parameters

NameTypeDescription
frameIdPage.FrameIdIdentifier of the frame where "via-inspector" stylesheet should be created.
force (optional)booleanIf 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

NameTypeDescription
styleSheetIdDOM.StyleSheetIdIdentifier 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"}