Moves chrome extentions to nostow

This commit is contained in:
Jonathan Hodgson 2019-07-30 15:13:38 +01:00
parent d62fc69775
commit 67c5765d10
8 changed files with 0 additions and 0 deletions

View file

@ -1,29 +0,0 @@
if(window.location.host.indexOf(".local.jh") == -1){
var xhr = new XMLHttpRequest();
xhr.open('GET', 'https://dotjs.local.jh/' + window.location.host.replace(/^www\./, '') + '.js');
xhr.onreadystatechange = function() {
if(xhr.readyState == 4) {
if(xhr.status == 200) {
var script = document.createElement('script');
script.textContent = xhr.responseText;
document.head.appendChild(script);
return;
} else if(xhr.status == 404) {
var defaultXHR = new XMLHttpRequest();
defaultXHR.open('GET', 'https://dotjs.local.jh/default.js');
defaultXHR.onreadystatechange = function() {
if (defaultXHR.readyState == 4 && defaultXHR.status == 200){
var script = document.createElement('script');
script.textContent = defaultXHR.responseText;
document.head.appendChild(script);
return;
}
}
defaultXHR.send();
}
}
};
xhr.send();
}