Add dotjs and dotcss

This commit is contained in:
Jonathan Hodgson 2017-08-09 13:15:49 +01:00
parent dad0b115d6
commit 27a1d00d42
14 changed files with 4282 additions and 0 deletions

View file

@ -0,0 +1,27 @@
var xhr = new XMLHttpRequest();
xhr.open('GET', 'https://dotcss.local/' + 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/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,27 @@
var xhr = new XMLHttpRequest();
xhr.open('GET', 'https://dotjs.local/' + 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/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"]
}

View file

@ -0,0 +1,4 @@
body{
background-color: #2d3242;
color: white;
}

View file

4195
config/dotcss/github.com.css Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1 @@
google.com.css

View file

0
config/dotjs/default.js Normal file
View file