Created
February 27, 2015 10:22
-
-
Save ShingoFukuyama/0d8cb585c8847e0ad5d2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Ohajiki Web Browser 独自スタイルシートの例 | |
// | |
// 設定>ユーザースクリプトの編集>読み込み前 で編集可能 | |
// | |
(function(){ | |
var d = document; | |
/* 現在のURLやドメイン */ | |
var url = location.href; | |
var domain = location.hostname; | |
/* URLの条件を指定 */ | |
if (domain.match('.google.co.jp') | |
|| domain.match('.google.com') ) { | |
var css = d.createElement('style'); | |
/* 適用するCSSを記述 */ | |
var rule = d.createTextNode('* { background-color: #000 !important; color: #eee !important; } a { color: #acf !important; }'); | |
css.type = 'text/css'; | |
if (css.styleSheet) { | |
css.styleSheet.cssText = rule.nodeValue; | |
} else { | |
css.appendChild(rule); | |
}; | |
d.getElementsByTagName('html')[0].appendChild(css); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment