Grab Link Toped

Go to 10 Ribu Orderan Per Hari!

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey, Greasemonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

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.

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

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

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         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';
        }
    });
})();