removeAllScripts static method

dynamic removeAllScripts(
  1. HtmlDocument htmlDoc
)

Removes suspect script tags from htmlDoc.

Implementation

static removeAllScripts(HtmlDocument htmlDoc) {
  log.info('Function : removeAllScripts, Parameters : {[htmlDoc,$htmlDoc]}');
  htmlDoc
      .querySelectorAll('script')
      .where((e) => _whitelistScripts(e) == false)
      .forEach((Element e) {
    log.finest('Function : removeAllScripts, removed : ${e.outerHtml}');
    e.remove();
  });
  log.fine('Function : removeAllScripts, Return : void');
}