insertCSS method

  1. @Deprecated(r'Replaced by $(ref:scripting.insertCSS) in Manifest V3.')
Future<void> insertCSS(
  1. int? tabId,
  2. InjectDetails details
)

Injects CSS into a page. Styles inserted with this method can be removed with scripting.removeCSS. For details, see the programmatic injection section of the content scripts doc. tabId The ID of the tab in which to insert the CSS; defaults to the active tab of the current window. details Details of the CSS text to insert. Either the code or the file property must be set, but both may not be set at the same time. returns Called when all the CSS has been inserted.

Implementation

@Deprecated(r'Replaced by $(ref:scripting.insertCSS) in Manifest V3.')
Future<void> insertCSS(
  int? tabId,
  InjectDetails details,
) async {
  await promiseToFuture<void>($js.chrome.tabs.insertCSS(
    tabId,
    details.toJS,
  ));
}