StartPage.com - Number Results

Number search results on StartPage.com and other Ixquick sites - StartingPage.com and Ixquick.com

目前为 2014-06-29 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name StartPage.com - Number Results
  3. // @namespace tag:r-a-y@gmx.com,2012:monkey
  4. // @description Number search results on StartPage.com and other Ixquick sites - StartingPage.com and Ixquick.com
  5. // @include http://*startpage.com/*
  6. // @include https://*startpage.com/*
  7. // @include http://*startingpage.com/*
  8. // @include https://*startingpage.com/*
  9. // @include http://*ixquick.com/*
  10. // @include https://*ixquick.com/*
  11. // @author r-a-y
  12. // @version 1.0
  13. // @license GPL v3
  14. // ==/UserScript==
  15.  
  16. var results = document.evaluate( "// a[contains(@id,'title_')]", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null );
  17.  
  18. for ( i = 0; i < results.snapshotLength; i++ ) {
  19. sp_add_num( results.snapshotItem(i).id.substr( 6, results.snapshotItem(i).id.length ), results.snapshotItem(i) );
  20. }
  21.  
  22. function sp_add_num( id, item ) {
  23. newSpan = document.createElement( "span" );
  24. newSpan.setAttribute( "style", "font-weight:bold; font-size:13px; display:inline-block; margin-right:5px;" );
  25.  
  26. newContent = document.createTextNode( id + ". ");
  27. newSpan.appendChild( newContent )
  28.  
  29. item.parentNode.insertBefore( newSpan, item );
  30. }