showlinks

Show links of page as text following the link

  1. // showlinks.user.js
  2. //
  3. // ==UserScript==
  4. // @name showlinks
  5. // @namespace http://www.devoresoftware.com/gm/showlinks
  6. // @description Show links of page as text following the link
  7. // @include *
  8. // @version 2.0
  9. // ==/UserScript==
  10. //
  11.  
  12. function main()
  13. {
  14. var anchors = document.getElementsByTagName('A');
  15. var len = anchors.length;
  16. for (var i = 0; i < len; i++)
  17. {
  18. var anchor = anchors[i];
  19. var hrefValue = anchor.getAttribute('href');
  20. var expansion = " [" + hrefValue + "] ";
  21. anchor.appendChild(document.createTextNode(expansion));
  22. }
  23. }
  24.  
  25. main();