Add dotjs and dotcss

Jonathan Hodgson 7 years ago
parent dad0b115d6
commit 27a1d00d42
  1. 27
      chromeExtentions/dotcss/dotcss.js
  2. BIN
      chromeExtentions/dotcss/icon128.png
  3. BIN
      chromeExtentions/dotcss/icon48.png
  4. 14
      chromeExtentions/dotcss/manifest.json
  5. 27
      chromeExtentions/dotjs/dotjs.js
  6. BIN
      chromeExtentions/dotjs/icon128.png
  7. BIN
      chromeExtentions/dotjs/icon48.png
  8. 14
      chromeExtentions/dotjs/manifest.json
  9. 4
      config/dotcss/default.css
  10. 0
      config/dotcss/fellowship.local.css
  11. 4195
      config/dotcss/github.com.css
  12. 1
      config/dotcss/google.co.uk.css
  13. 0
      config/dotcss/google.com.css
  14. 0
      config/dotjs/default.js

@ -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.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

@ -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"]
}

@ -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

@ -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"]
}

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

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save