diff --git a/components/script/dom/navigator.rs b/components/script/dom/navigator.rs index ee67359f859..732f6b009cb 100644 --- a/components/script/dom/navigator.rs +++ b/components/script/dom/navigator.rs @@ -224,9 +224,10 @@ impl NavigatorMethods for Navigator { /// fn OnLine(&self) -> bool { - true + *self.global().is_online().lock().unwrap() } + // https://html.spec.whatwg.org/multipage/#dom-navigator-plugins fn Plugins(&self) -> DomRoot { self.plugins diff --git a/components/script/dom/workernavigator.rs b/components/script/dom/workernavigator.rs index 0b0e90ffd0c..167f2460ba4 100644 --- a/components/script/dom/workernavigator.rs +++ b/components/script/dom/workernavigator.rs @@ -19,6 +19,7 @@ use crate::dom::webgpu::gpu::GPU; use crate::dom::workerglobalscope::WorkerGlobalScope; use crate::script_runtime::{CanGc, JSContext}; + // https://html.spec.whatwg.org/multipage/#workernavigator #[dom_struct] pub(crate) struct WorkerNavigator { @@ -107,7 +108,7 @@ impl WorkerNavigatorMethods for WorkerNavigator { /// fn OnLine(&self) -> bool { - true + *self.global().is_online().lock().unwrap() } // https://w3c.github.io/permissions/#navigator-and-workernavigator-extension