eBay Extras

Replaces default navigation buttons, adds a notification bar when searching for 'US only' or when searching for 'Sold items', removes selling ad, fixes styling issues caused by body background image

От 09.08.2019. Виж последната версия.

За да инсталирате този скрипт, трябва да имате инсталирано разширение като Tampermonkey, Greasemonkey или Violentmonkey.

За да инсталирате този скрипт, трябва да инсталирате разширение, като например Tampermonkey .

За да инсталирате този скрипт, трябва да имате инсталирано разширение като Tampermonkey или Violentmonkey.

За да инсталирате този скрипт, трябва да имате инсталирано разширение като Tampermonkey или Userscripts.

За да инсталирате скрипта, трябва да инсталирате разширение като Tampermonkey.

За да инсталирате този скрипт, трябва да имате инсталиран скриптов мениджър.

(Вече имам скриптов мениджър, искам да го инсталирам!)

За да инсталирате този стил, трябва да инсталирате разширение като Stylus.

За да инсталирате този стил, трябва да инсталирате разширение като Stylus.

За да инсталирате този стил, трябва да инсталирате разширение като Stylus.

За да инсталирате този стил, трябва да имате инсталиран мениджър на потребителски стилове.

За да инсталирате този стил, трябва да имате инсталиран мениджър на потребителски стилове.

За да инсталирате този стил, трябва да имате инсталиран мениджър на потребителски стилове.

(Вече имам инсталиран мениджър на стиловете, искам да го инсталирам!)

// ==UserScript==
// @name         eBay Extras
// @version      0.3
// @description  Replaces default navigation buttons, adds a notification bar when searching for 'US only' or when searching for 'Sold items', removes selling ad, fixes styling issues caused by body background image
// @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:"(.*?)"}/)[1];
    addLink("Feedback","https://feedback.ebay.com/ws/eBayISAPI.dll?ViewFeedback2&ftab=AllFeedback&userid="+userId)
    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 selling ad
    document.getElementById('gh-ti').style.display="none";

    // Get page location
    var loc = window.location.toString()

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

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

    // Kill the background image
    window.onload = function () { document.body.style.backgroundImage=""; }

})();