3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

FirefoxのGoogle検索ではてブ数を表示(+改良)

Last updated at Posted at 2014-05-25

Firefoxのはてブアドオンではできなくて、探したら
Social bookmark counter on Google search. for Greasemonkeyを使うのがよさそうな感じだったから入れた

ページを開いてから徐々に要素の高さが変更されるのがいやだったのとはてブ数以外特に使わなさそうだったから修正

  • 修正前

before.png

  • 修正後

after.png

--- 115527.user.js   2014-05-25 12:47:30.000000000 +0900
+++ 115527.user.js   2014-05-25 12:48:04.000000000 +0900
@@ -261,15 +261,15 @@

   try {
     // normal
-    var s = link.parentNode.parentNode.getElementsByClassName('s')[0];
-    var ss = link.parentNode.parentNode.parentNode.getElementsByClassName('s')[0];
+    var s = link.parentNode.parentNode.getElementsByClassName('r')[0];
+    var ss = link.parentNode.parentNode.parentNode.getElementsByClassName('r')[0];
     if (s) {
       var tonode = s.childNodes[0];
-      tonode.parentNode.insertBefore(span, tonode.parentNode.firstChild);
+      tonode.parentNode.insertBefore(span, tonode.parentNode.firstChild.nextSibling);
     }
     else if (ss) {
       var tonode = ss.childNodes[0];
-      tonode.parentNode.insertBefore(span, tonode.parentNode.firstChild);
+      tonode.parentNode.insertBefore(span, tonode.parentNode.firstChild.nextSibling);
     }
     else {
       link.parentNode.insertBefore(span, link.nextSibling);
@@ -576,11 +576,11 @@
   }

   asyncProcArray(params, hatebuCountView, fin);
-  asyncProcArray(params, deliCountView, fin);
-  asyncProcArray(params, facebookCountView, fin);
-  asyncProcArray(params, twitterCountView, fin);
-  asyncProcArray(params, stumbleuponCountView, fin);
-  asyncProcArray(params, redditCountView, fin);
+  // asyncProcArray(params, deliCountView, fin);
+  // asyncProcArray(params, facebookCountView, fin);
+  // asyncProcArray(params, twitterCountView, fin);
+  // asyncProcArray(params, stumbleuponCountView, fin);
+  // asyncProcArray(params, redditCountView, fin);
   // asyncProcArray(params, diggCountView, fin);
 }
3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?