Skip to content

Instantly share code, notes, and snippets.

@songxiaofeng1981
Created November 22, 2012 06:48
Show Gist options
  • Save songxiaofeng1981/4129724 to your computer and use it in GitHub Desktop.
Save songxiaofeng1981/4129724 to your computer and use it in GitHub Desktop.
monkey:getchannelid
// Hello World! example user script
// version 0.1 BETA!
// 2005-04-25
// Copyright (c) 2005, Mark Pilgrim
// Released under the GPL license
// http://www.gnu.org/copyleft/gpl.html
//
// --------------------------------------------------------------------
//
// This is a Greasemonkey user script. To install it, you need
// Greasemonkey 0.3 or later: http://greasemonkey.mozdev.org/
// Then restart Firefox and revisit this script.
// Under Tools, there will be a new menu item to "Install User Script".
// Accept the default configuration and install.
//
// To uninstall, go to Tools/Manage User Scripts,
// select "Hello World", and click Uninstall.
//
// --------------------------------------------------------------------
//
// ==UserScript==
// @name chinacache tools
// @namespace http://diveintomark.org/projects/greasemonkey/
// @description example script to alert "Hello world!" on every page
// @include *
// @exclude http://diveintogreasemonkey.org/*
// @exclude http://www.diveintogreasemonkey.org/*
// ==/UserScript==
var a = document.getElementById('selectedChannelId')
for(i = 0; i < a.options.length; i++) {
// document.write(a.options[i].value + ' ' + a.options[i].text + '\<br>')
var logo = document.createElement("div");
logo.innerHTML = '<div style="margin: 0 auto 0 auto; ' +
'border-bottom: 1px solid #000000; margin-bottom: 5px; ' +
'font-size: small"><p style="margin: 2px 0 1px 0;"> ' +
a.options[i].value + ' ' + a.options[i].text + '\<br>' +
'</p></div>';
document.body.insertBefore(logo, document.body.firstChild);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment