Show URL instead of QR

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==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(){}});
    }
})();