Changeset 8538 for lang/javascript

Show
Ignore:
Timestamp:
03/31/08 02:55:22 (7 years ago)
Author:
drry
Message:

lang/javascript/userscripts/hatebuclippingsiteremover.user.js:

  • tweaked.
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/javascript/userscripts/hatebuclippingsiteremover.user.js

    r8481 r8538  
    44// @description    remove clipping sites 
    55// @include        http://b.hatena.ne.jp/entry/* 
    6 // @version        1.0.1 
     6// @version        1.0.2 
    77// ==/UserScript== 
    88(function() { 
    9     var bookmarklist = getElementsByXPath('//ul[@class="bookmarklist" and not(@id="bookmarked_user")]//li/a[@href]'); 
     9    var bookmarklist = getElementsByXPath('//ul[contains(concat(" ", normalize-space(@class), " "), " bookmarklist ") and not(@id="bookmarked_user")]//li/a[@href]'); 
    1010    if (!bookmarklist) return; 
    1111 
     
    2020        ,"http://d.hatena.ne.jp/hengsu/" 
    2121    ]; 
    22     const LABEL = "Clipping site REMOVED"; 
     22    const LABEL = '<span style="font-size: smaller">Clipping site REMOVED</span>'; 
    2323 
    2424    if (typeof bookmarklist.forEach == "function") 
     
    3939                return url.indexOf(site) == 0; 
    4040            }); 
    41         else for (var i = CLIPPINGSITELIST.length; i --> 0; ) 
     41        else for (var i = CLIPPINGSITELIST.length; i --> 0;) 
    4242            if (url.indexOf(CLIPPINGSITELIST[i]) == 0) 
    4343                return true; 
     
    4646 
    4747    function getElementsByXPath(xpath, node) { 
    48         var node = node || document; 
    49         var results = document.evaluate(xpath, node, null, 
     48        var results = document.evaluate(xpath, node || document, null, 
    5049                                        XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); 
    5150        var nodes = [];