From 06a45c6c68d3fcccdc1ca91b4e3d3fd4abcfca57 Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Thu, 4 Oct 2018 16:49:39 +0100 Subject: [PATCH] Make dotjs work with .local.jh --- chromeExtentions/dotjs/dotjs.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/chromeExtentions/dotjs/dotjs.js b/chromeExtentions/dotjs/dotjs.js index a1a24423..0de96e13 100644 --- a/chromeExtentions/dotjs/dotjs.js +++ b/chromeExtentions/dotjs/dotjs.js @@ -1,6 +1,8 @@ -if(window.location.host.indexOf(".local") != -1){ +console.log( "yay" ); +if(window.location.host.indexOf(".local.jh") == -1){ +console.log( "I get here" ); var xhr = new XMLHttpRequest(); - xhr.open('GET', 'https://dotjs.local/' + window.location.host.replace(/^www\./, '') + '.js'); + xhr.open('GET', 'https://dotjs.local.jh/' + window.location.host.replace(/^www\./, '') + '.js'); xhr.onreadystatechange = function() { if(xhr.readyState == 4) { @@ -11,7 +13,7 @@ if(window.location.host.indexOf(".local") != -1){ return; } else if(xhr.status == 404) { var defaultXHR = new XMLHttpRequest(); - defaultXHR.open('GET', 'https://dotjs.local/default.js'); + defaultXHR.open('GET', 'https://dotjs.local.jh/default.js'); defaultXHR.onreadystatechange = function() { if (defaultXHR.readyState == 4 && defaultXHR.status == 200){ var script = document.createElement('script');