eBay Extras

Replaces default navigation buttons, adds a notification bar when searching for 'US only' or when searching for 'Sold items', removes certain ads

Verzia zo dňa 09.08.2019. Pozri najnovšiu verziu.

Na nainštalovanie skriptu si budete musieť nainštalovať rozšírenie, ako napríklad Tampermonkey, Greasemonkey alebo Violentmonkey.

Na inštaláciu tohto skriptu je potrebné nainštalovať rozšírenie, ako napríklad Tampermonkey.

Na nainštalovanie skriptu si budete musieť nainštalovať rozšírenie, ako napríklad Tampermonkey, % alebo Violentmonkey.

Na nainštalovanie skriptu si budete musieť nainštalovať rozšírenie, ako napríklad Tampermonkey alebo Userscripts.

Na inštaláciu tohto skriptu je potrebné nainštalovať rozšírenie, ako napríklad Tampermonkey.

Na inštaláciu tohto skriptu je potrebné nainštalovať rozšírenie správcu používateľských skriptov.

(Už mám správcu používateľských skriptov, nechajte ma ho nainštalovať!)

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie, ako napríklad Stylus.

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie, ako napríklad Stylus.

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie, ako napríklad Stylus.

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie správcu používateľských štýlov.

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie správcu používateľských štýlov.

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie správcu používateľských štýlov.

(Už mám správcu používateľských štýlov, nechajte ma ho nainštalovať!)

// ==UserScript==
// @name         eBay Extras
// @version      0.8
// @description  Replaces default navigation buttons, adds a notification bar when searching for 'US only' or when searching for 'Sold items', removes certain ads
// @author       asheroto
// @match        https://*.ebay.com/*
// @namespace    http://asher.tools/ebay-extras-script
// ==/UserScript==

(function() {

    // Insert nav buttons
    function addLink(text,url) {
        var bodChild = document.createElement("li");
        bodChild.classList.add("gh-t");
        bodChild.classList.add("gh-divider-l");
        bodChild.id = "gh-p-3";
        bodChild.innerHTML = '<a href="'+url+'" class="gh-p"> '+text+'</a>';
        document.getElementById('gh-p-3').parentNode.insertBefore(bodChild, document.getElementById('gh-p-3').nextSibling);
    }
    addLink("Orders","https://www.ebay.com/sh/ord/?filter=status:ALL_ORDERS");
    addLink("Active Listings","https://www.ebay.com/sh/lst/active");
    addLink("Purchases","https://www.ebay.com/myb/PurchaseHistory");
    addLink("Watch List","https://www.ebay.com/myb/WatchList");
    addLink("Messages","https://mesg.ebay.com/mesgweb/ViewMessages/0");
    var userId = document.body.innerHTML.match(/id:"(.*?)"}/);
    if(userId) { var userFeedbackId = userId[1]; addLink("Feedback","https://feedback.ebay.com/ws/eBayISAPI.dll?ViewFeedback2&ftab=AllFeedback&userid="+userFeedbackId); }
    addLink("Account Settings","https://my.ebay.com/ws/eBayISAPI.dll?MyEbay&CurrentPage=MyeBayMyAccounts&ssPageName=STRK:ME:MAX");

    // Remove buttons
    document.getElementById('gh-p-4').style.display="none";
    document.getElementById('gh-p-1').style.display="none";
    document.getElementById('gh-p-3').style.display="none";

    // Remove ads
    var ad1 = document.getElementById('gh-ti');
    if(ad1) { ad1.style.display="none"; }
    var ad2 = document.getElementsByClassName('topRtm')[0];
    if(ad2) { ad2.style.display="none"; }
    var ad3 = document.getElementsByClassName('hl-leaderboard-ad')[0];
    if(ad3) { ad3.style.display="none"; }

    // Function for top bar
    function addTopBar(atext) {
        var elChild = document.createElement("div");
        elChild.style.background = "black";
        elChild.style.color = "white";
        elChild.innerHTML = '<center><font size=4>'+atext+'</font></center>';
        document.body.insertBefore(elChild, document.body.firstChild);
    }
    // Notify if searching US only
    if(window.location.toString().includes("LH_PrefLoc=1")) {
        addTopBar('Showing items from USA');
    }

    // Notify if searching sold items
    if(window.location.toString().includes("LH_Sold=1")) {
        addTopBar('Showing Sold + Completed Items');
    }

})();