Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions core/extensions/chrome/contentscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,16 @@ function insertScript(url) {
// the main page.
// script.src = url;
var xhr = new XMLHttpRequest();
xhr.open('GET', url, false);
xhr.send('');
script.text = xhr.responseText;
xhr.open('GET', url, true);
xhr.send();
xhr.onreadystatechange = function () {
if (this.readyState === this.DONE) {
script.text = this.responseText;
insertHeaderNode(script);
notifyPresent();
}
};

insertHeaderNode(script);
return script;
};

Expand All @@ -99,8 +104,6 @@ if (sessionStorage[sessionKey] == "yes") {
insertStylesheet(cssurl);
insertScript(jsurl);
}

notifyPresent();
}

// Once the DOM is ready, bind to the content event
Expand Down