Show URL instead of QR

直接显示二维码中的链接,用手机扫描太麻烦了。比如动漫领域的磁链...

  1. // ==UserScript==
  2. // @name Show URL instead of QR
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.2·
  5. // @description 直接显示二维码中的链接,用手机扫描太麻烦了。比如动漫领域的磁链...
  6. // @author etng
  7. // @match *://dmly.me/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=dmly.me
  9. // @grant GM_notification
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14. var $ = unsafeWindow.jQuery;
  15. var cnt = 0
  16. $('img[src^="https://api.qrserver.com/v1/create-qr-code/"]').each((k,v)=>{
  17. var a=$(v);
  18. var u=new URL(a.attr('src'))
  19. var link = u.searchParams.get('data')
  20. a.after($('<div/>').append($('<a>').attr('href', link).text(link)))
  21. cnt +=1
  22. })
  23. if(cnt>0){
  24. GM_notification({text: `成功提取${cnt}个QR`, timeout: 800, onclick: function(){}});
  25. }
  26. })();