Skip to content

Instantly share code, notes, and snippets.

@ShingoFukuyama
Created February 27, 2015 10:22
Show Gist options
  • Save ShingoFukuyama/0d8cb585c8847e0ad5d2 to your computer and use it in GitHub Desktop.
Save ShingoFukuyama/0d8cb585c8847e0ad5d2 to your computer and use it in GitHub Desktop.
// 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