Notify devtools about new script globals sooner.

This commit is contained in:
Josh Matthews 2015-12-15 14:08:01 -05:00
parent e6d906dbbf
commit a1f0b39340

View file

@ -1841,6 +1841,9 @@ impl ScriptThread {
let ConstellationChan(ref chan) = self.constellation_chan;
chan.send(ConstellationMsg::ActivateDocument(incomplete.pipeline_id)).unwrap();
// Notify devtools that a new script global exists.
self.notify_devtools(document.Title(), final_url.clone(), (page.pipeline(), None));
let is_javascript = incomplete.url.scheme == "javascript";
let parse_input = if is_javascript {
use url::percent_encoding::percent_decode_to;
@ -2200,11 +2203,6 @@ impl ScriptThread {
document.process_deferred_scripts();
window.set_fragment_name(final_url.fragment.clone());
// Notify devtools that a new script global exists.
//TODO: should this happen as soon as the global is created, or at least once the first
// script runs?
self.notify_devtools(document.Title(), (*final_url).clone(), (id, None));
}
fn handle_css_error_reporting(&self, pipeline_id: PipelineId, filename: String,