//bool Navigator::webdriver() const {
// if (RuntimeEnabledFeatures::AutomationControlledEnabled())
// return true;
//
// bool automation_enabled = false;
// probe::ApplyAutomationOverride(GetExecutionContext(), automation_enabled);
// return automation_enabled;
//}
bool Navigator::webdriver() const {
return false;
}
//uint32_t NetworkInformation::rtt() {
// MaybeShowWebHoldbackConsoleMsg();
// std::optional override_rtt =
// GetNetworkStateNotifier().GetWebHoldbackHttpRtt();
// if (override_rtt) {
// return GetNetworkStateNotifier().RoundRtt(Host(), override_rtt.value());
// }
//
// if (!IsObserving()) {
// return GetNetworkStateNotifier().RoundRtt(
// Host(), GetNetworkStateNotifier().HttpRtt());
// }
//
// return http_rtt_msec_;
//}
uint32_t NetworkInformation::rtt() {
return 150;
}
String Notification::PermissionString(
mojom::blink::PermissionStatus permission) {
switch (permission) {
case mojom::blink::PermissionStatus::GRANTED:
return "granted";
case mojom::blink::PermissionStatus::DENIED:
//return "denied";
return "default";
case mojom::blink::PermissionStatus::ASK:
return "default";
}
NOTREACHED();
//return "denied";
return "default";
}
针对无头浏览器的HeadlessChrome:
//const char kHeadlessProductName[] = "HeadlessChrome";
const char kHeadlessProductName[] = "Chrome";
// static
//DOMPluginArray* NavigatorPlugins::plugins(Navigator& navigator) {
// return NavigatorPlugins::From(navigator).plugins(navigator.DomWindow());
//}
// static
DOMPluginArray* NavigatorPlugins::plugins(Navigator& navigator) {
DOMPluginArray* pluginsArray = NavigatorPlugins::From(navigator).plugins(navigator.DomWindow());
pluginsArray->UpdatePluginData();
return pluginsArray;
}
void DOMPluginArray::UpdatePluginData() {
if (should_return_fixed_plugin_data_) {
dom_plugins_.clear();
//if (IsPdfViewerAvailable()) {
// See crbug.com/1164635 and https://github.com/whatwg/html/pull/6738.
// To reduce fingerprinting and make plugins/mimetypes more
// interoperable, this is the spec'd, hard-coded list of plugins:
Vector<String> plugins{"PDF Viewer", "Chrome PDF Viewer",
"Chromium PDF Viewer", "Microsoft Edge PDF Viewer",
"WebKit built-in PDF"};
for (auto name : plugins)
dom_plugins_.push_back(MakeFakePlugin(name, DomWindow()));
//}
return;
}