Run a script in a new DebuggerGlobalScope

Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
This commit is contained in:
Delan Azabani 2025-07-18 21:51:13 +08:00
parent 186558ca08
commit 23c166fcf1
7 changed files with 123 additions and 3 deletions

View file

@ -114,7 +114,7 @@ use crate::dom::reportingobserver::ReportingObserver;
use crate::dom::serviceworker::ServiceWorker;
use crate::dom::serviceworkerregistration::ServiceWorkerRegistration;
use crate::dom::trustedtypepolicyfactory::TrustedTypePolicyFactory;
use crate::dom::types::MessageEvent;
use crate::dom::types::{DebuggerGlobalScope, MessageEvent};
use crate::dom::underlyingsourcecontainer::UnderlyingSourceType;
#[cfg(feature = "webgpu")]
use crate::dom::webgpu::gpudevice::GPUDevice;
@ -2530,6 +2530,9 @@ impl GlobalScope {
// https://drafts.css-houdini.org/worklets/#script-settings-for-worklets
return worklet.base_url();
}
if let Some(_debugger_global) = self.downcast::<DebuggerGlobalScope>() {
return self.creation_url.clone();
}
unreachable!();
}
@ -2545,6 +2548,9 @@ impl GlobalScope {
// TODO: is this the right URL to return?
return worklet.base_url();
}
if let Some(_debugger_global) = self.downcast::<DebuggerGlobalScope>() {
return self.creation_url.clone();
}
unreachable!();
}