diff options
author | Taym Haddadi <haddadi.taym@gmail.com> | 2024-09-09 17:09:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-09 15:09:06 +0000 |
commit | 8c0a566860cf0f43662dc9d6c3474ae194c1a9fc (patch) | |
tree | b260e825e21295d07553bb64d463f4c3f18a9c8e /components/script/script_thread.rs | |
parent | d169a82d2e146704db3d9eb2b5f9f49f9ef8b1da (diff) | |
download | servo-8c0a566860cf0f43662dc9d6c3474ae194c1a9fc.tar.gz servo-8c0a566860cf0f43662dc9d6c3474ae194c1a9fc.zip |
Fix devtool crashs after entering window.location in console (#33381)
Signed-off-by: Taym <haddadi.taym@gmail.com>
Diffstat (limited to 'components/script/script_thread.rs')
-rw-r--r-- | components/script/script_thread.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index a7c91cc9a49..9677c371ff3 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -113,6 +113,7 @@ use crate::dom::bindings::reflector::DomObject; use crate::dom::bindings::root::{ Dom, DomRoot, MutNullableDom, RootCollection, ThreadLocalStackRoots, }; +use crate::dom::bindings::settings_stack::AutoEntryScript; use crate::dom::bindings::str::DOMString; use crate::dom::bindings::trace::{HashMapTracedValues, JSTraceable}; use crate::dom::customelementregistry::{ @@ -2518,7 +2519,11 @@ impl ScriptThread { let documents = self.documents.borrow(); match msg { DevtoolScriptControlMsg::EvaluateJS(id, s, reply) => match documents.find_window(id) { - Some(window) => devtools::handle_evaluate_js(window.upcast(), s, reply), + Some(window) => { + let global = window.upcast::<GlobalScope>(); + let _aes = AutoEntryScript::new(&global); + devtools::handle_evaluate_js(&global, s, reply) + }, None => warn!("Message sent to closed pipeline {}.", id), }, DevtoolScriptControlMsg::GetRootNode(id, reply) => { |