diff options
author | Josh Matthews <josh@joshmatthews.net> | 2019-01-15 15:22:13 -0500 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2019-01-15 15:22:13 -0500 |
commit | 66c2e42ed9f4b07d5be2a0d5ac99e0981b1c5b8e (patch) | |
tree | 989159eb5d688049e9581a6542740f8a71a12e61 /components/script/dom/userscripts.rs | |
parent | 18cfb9378df73359eae0867e01f18e7913e0e8dd (diff) | |
download | servo-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.rs | 7 |
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, + ); } })); } |