Moves chrome extentions to nostow

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

View file

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

View file

@ -0,0 +1,14 @@
{
"name" : "dotcss",
"manifest_version" : 2,
"version" : "2.2.0",
"description" : "~/.css",
"icons": { "48" : "icon48.png", "128" : "icon128.png" },
"content_scripts": [{
"all_frames" : true,
"run_at" : "document_start",
"matches" : ["http://*/*", "https://*/*"],
"js" : ["dotcss.js"]
}],
"permissions": ["tabs"]
}

View file

@ -0,0 +1,29 @@
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();
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 922 B

View file

@ -0,0 +1,14 @@
{
"name" : "dotjs",
"manifest_version" : 2,
"version" : "2.2.0",
"description" : "~/.js",
"icons": { "48" : "icon48.png", "128" : "icon128.png" },
"content_scripts": [{
"all_frames" : true,
"run_at" : "document_start",
"matches" : ["http://*/*", "https://*/*"],
"js" : ["dotjs.js"]
}],
"permissions": ["tabs"]
}