Show URL instead of QR

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

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Show URL instead of QR
// @namespace    http://tampermonkey.net/
// @version      0.2·
// @description  直接显示二维码中的链接,用手机扫描太麻烦了。比如动漫领域的磁链...
// @author       etng
// @match        *://dmly.me/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=dmly.me
// @grant        GM_notification
// ==/UserScript==

(function() {
    'use strict';
    var $ = unsafeWindow.jQuery;
    var cnt = 0
    $('img[src^="https://api.qrserver.com/v1/create-qr-code/"]').each((k,v)=>{
        var a=$(v);
        var u=new URL(a.attr('src'))
        var link = u.searchParams.get('data')
        a.after($('<div/>').append($('<a>').attr('href', link).text(link)))
        cnt +=1
    })
    if(cnt>0){
        GM_notification({text: `成功提取${cnt}个QR`, timeout: 800, onclick: function(){}});
    }
})();