Skip to content

Instantly share code, notes, and snippets.

@qingfeng
Created October 15, 2010 12:09
Show Gist options
  • Save qingfeng/628093 to your computer and use it in GitHub Desktop.
Save qingfeng/628093 to your computer and use it in GitHub Desktop.
Chrome user Script Demo
// ==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