← Back to CSS domain

CSS.getStyleSheetText

Returns the current textual content for a stylesheet.

Domain: CSS experimental

Parameters

NameTypeDescription
styleSheetIdDOM.StyleSheetId

Returns

NameTypeDescription
textstringThe stylesheet text.

Example Request

{
  "id": 1,
  "method": "CSS.getStyleSheetText",
  "params": {
    "styleSheetId": "styleSheetId-value"
  }
}

Example Response

{
  "id": 1,
  "result": {
    "text": "text-value"
  }
}

Usage in Node.js

const result = await send('CSS.getStyleSheetText', {"styleSheetId": "styleSheetId-value"});
console.log(result);
// {"text": "text-value"}