全ユーザに、はてなブックマークプラスアイコンを付ける JavaScript と Greasemonkey
逆に考えるんだ!皆に付いていればいいんじゃね?
var img = Ten.Element('img', { width: '25', height: '11', title: 'はてなブックマークプラス', src: '/images/plus.gif' }); var plus_icon = Ten.Element('a', { href: '/guid/plus' }, img); Ten.DOM.addClassName(plus_icon, 'plus_icon'); Ten.DOM.getElementsByClassName('username') .forEach(function(element) { var next = Ten.DOM.nextElement(element); if (!Ten.DOM.hasClassName(next, 'plus_icon')) { Ten.DOM.insertBefore(plus_icon.cloneNode(true), next); } })
greasemonkey
// ==UserScript== // @namespace http://d.hatena.ne.jp/TakiTake/ // @include http://b.hatena.ne.jp/entry/* // @include http://b.hatena.ne.jp/entry?mode=more&url=* // ==/UserScript== var Ten = unsafeWindow.Ten; // Tenオブジェクト引っ張ってくる var img = Ten.Element('img', { width: '25', height: '11', title: 'はてなブックマークプラス', src: '/images/plus.gif' }); var plus_icon = Ten.Element('a', { href: '/guid/plus' }, img); Ten.DOM.addClassName(plus_icon, 'plus_icon'); Ten.DOM.getElementsByClassName('username') .forEach(function(element) { var next = Ten.DOM.nextElement(element); if (!Ten.DOM.hasClassName(next, 'plus_icon')) { Ten.DOM.insertBefore(plus_icon.cloneNode(true), next); } })