pageCreated method

  1. @override
Future<void> pageCreated(
  1. Page page
)
override

Implementation

@override
Future<void> pageCreated(Page page) async {
  var jsOnNewDocument = StringBuffer();
  for (var js in [
    _chromeRuntime,
    _consoleDebug,
    _navigatorLanguages,
    _navigatorPermission,
    _navigatorPlugin,
    _navigatorWebdriver,
    _webglVendor,
    _windowOuterDimensions,
  ]) {
    jsOnNewDocument.writeln('($js)();');
  }
  await page.evaluateOnNewDocument('function() { $jsOnNewDocument; }');

  await _anonymizeUserAgent(page);
}