Skip to content

Instantly share code, notes, and snippets.

@yonchu
Created May 13, 2012 12:56
Show Gist options
  • Save yonchu/2688337 to your computer and use it in GitHub Desktop.
Save yonchu/2688337 to your computer and use it in GitHub Desktop.
はてなブックマークChrome拡張の表示を修正するGreasemonkeyです。ニコニコ動画ランキングのブクマ数表示の改善、Faviconize Googleの表示改善を行います。
// ==UserScript==
// @name hatena bookmark fix
// @namespace http://d.hatena.ne.jp/yonchu
// @version 0.0.1
// @description hatena bookmark for Chrome Extension fix
// @include http://www.google.*/search?*
// @include https://www.google.*/search?*
// @include http://encrypted.google.*/search?*
// @include https://encrypted.google.*/search?*
// @include http://www.google.*/webhp*
// @include https://www.google.*/webhp*
// @include http://www.nicovideo.jp/ranking*
// @license MIT License(http://en.wikipedia.org/wiki/MIT_License)
// @see http://d.hatena.ne.jp/yonchu/
// ==/UserScript==
// Version History:
// 0.0.1 - 2012/05/13 リリース
(function() {
var addStyle = function(css) {
if (typeof GM_addStyle != 'undefined') {
GM_addStyle(css);
return;
}
var head = document.getElementsByTagName('head')[0];
var style = document.createElement("style");
style.type = "text/css";
style.appendChild(document.createTextNode(css));
head.appendChild(style);
};
if (document.location.href.match(/^https?:[/]{2}www\.google\..*$/)) {
addStyle(".hBookmark-widget-counter > img.favicon {\
display: none !important;\
}\
");
}
if (document.location.href.match(/^http:[/]{2}www\.nicovideo\.jp\/ranking(\/?|\/?[#?]+.*)$/)) {
addStyle(".hBookmark-widget-counter img {\
width: auto !important;\
height: auto !important;\
border: none !important;\
margin-top: -16px !important;\
}\
");
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment