forked from p3lim/dotjs-universal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dotjs.js
19 lines (15 loc) · 787 Bytes
/
dotjs.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
var hostname = location.hostname.replace(/^www\./, '');
var style = document.createElement('link');
style.rel = 'stylesheet';
style.href = chrome.extension.getURL('styles/' + hostname + '.css');
document.documentElement.insertBefore(style);
var defaultStyle = document.createElement('link');
defaultStyle.rel = 'stylesheet';
defaultStyle.href = chrome.extension.getURL('styles/default.css');
document.documentElement.insertBefore(defaultStyle);
var script = document.createElement('script');
script.src = chrome.extension.getURL('scripts/' + hostname + '.js');
document.documentElement.insertBefore(script);
var defaultScript = document.createElement('script');
defaultScript.src = chrome.extension.getURL('scripts/default.js');
document.documentElement.insertBefore(defaultScript);