Grab Link Toped

Go to 10 Ribu Orderan Per Hari!

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name         Grab Link Toped
// @namespace    http://tampermonkey.net/
// @version      0.20.91
// @description  Go to 10 Ribu Orderan Per Hari!
// @author       Jamielcs
// @match        https://www.tokopedia.com/manage-product-new.pl*
// @grant        none
// ==/UserScript==
(function() {
    'use strict';
 $('div.maincontent-admin.maincontent-admin--manageProduct').first().prepend($('\
<textarea id="kws" style="width:99%" rows=15></textarea>\
<button class="getlinktoped" style="display:block;width:100%;background:black;color:white">Get LInk</button>\
'));
    $('.getlinktoped').click(function(){
        var kws = document.getElementById('kws');
        kws.value='';
        var as = document.querySelectorAll('a.break-link.fs-13.fw-600.el');
        for(var i = 0; i < as.length; i++) {
            var anchor = as[i].pathname.split(/[\/\.]/).sort(function(a, b) { return b.length - a.length; }).shift().replace(/[-_\s]+/g,' ');
            var kw = as[i];
            if(kw) kws.value = kws.value+'<a target="_blank" href="'+decodeURIComponent(kw)+'">'+(anchor)+'</a><br/>\n';
        }
    });
})();