aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/userscripts.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2019-01-15 15:22:13 -0500
committerJosh Matthews <josh@joshmatthews.net>2019-01-15 15:22:13 -0500
commit66c2e42ed9f4b07d5be2a0d5ac99e0981b1c5b8e (patch)
tree989159eb5d688049e9581a6542740f8a71a12e61 /components/script/dom/userscripts.rs
parent18cfb9378df73359eae0867e01f18e7913e0e8dd (diff)
downloadservo-66c2e42ed9f4b07d5be2a0d5ac99e0981b1c5b8e.tar.gz
servo-66c2e42ed9f4b07d5be2a0d5ac99e0981b1c5b8e.zip
Pass a filename when executing user scripts.
Diffstat (limited to 'components/script/dom/userscripts.rs')
-rw-r--r--components/script/dom/userscripts.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/components/script/dom/userscripts.rs b/components/script/dom/userscripts.rs
index d9816648dec..1ba79ac5b69 100644
--- a/components/script/dom/userscripts.rs
+++ b/components/script/dom/userscripts.rs
@@ -40,7 +40,12 @@ pub fn load_script(head: &HTMLHeadElement) {
f.read_to_end(&mut contents).unwrap();
let script_text = String::from_utf8_lossy(&contents);
win.upcast::<GlobalScope>()
- .evaluate_js_on_global_with_result(&script_text, rval.handle_mut());
+ .evaluate_script_on_global_with_result(
+ &script_text,
+ &file.to_string_lossy(),
+ rval.handle_mut(),
+ 1,
+ );
}
}));
}