Created
October 15, 2010 12:09
-
-
Save qingfeng/628093 to your computer and use it in GitHub Desktop.
Chrome user Script Demo
This file contains hidden or 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
// ==UserScript== | |
// @name Demo | |
// @namespace http://youdomain.com | |
// @include http://www.douban.com/* | |
// @description Demo | |
// @version 20101015 | |
// ==/UserScript== | |
/*globals XPathResult, GM_getValue, GM_setValue, localStorage, unescape, | |
frameElement */ | |
"use strict"; | |
( function() { | |
var BASE_CSS = "" + | |
"#entries.comment-cards .entry-comments {" + | |
" background-color: transparent !important;" + | |
"}" | |
function addStyle( css ) { | |
var style = document.createElement( "style" ); | |
style.type = "text/css"; | |
style.textContent = css; // innerHTML throws NO_MODIFICATION_ALLOWED_ERR | |
document.getElementsByTagName( "head" )[0].appendChild( style ); | |
return style; | |
} | |
console.log("hi") | |
addStyle( BASE_CSS ); | |
}() ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment