De-anonymize links

Open anonimized/redirected links directly

当前为 2015-01-22 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name De-anonymize links
  3. // @description Open anonimized/redirected links directly
  4. // @version 1.0
  5. // @author wOxxOm
  6. // @namespace wOxxOm.scripts
  7. // @icon https://i.imgur.com/cfmXJHv.png
  8. // @license MIT License
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. window.addEventListener('click', function(e) {
  13. for (var a = e.target; a.localName != 'a'; a = a.parentNode)
  14. if (!a.parentNode)
  15. return;
  16. var m = a.href.match(/.+?(https?(?:%3[Aa]%2[Ff]%2[Ff]|:\/\/).+)$/);
  17. if (m) {
  18. a.href = decodeURIComponent(m[1]);
  19. console.log('De-anonymized: ' + a.href);
  20. }
  21. });