Add listing

Add a add listing button to your traderie page!

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Add listing
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Add a add listing button to your traderie page! 
// @author       MythicalHysteria
// @match        https://traderie.com/*/product/*
// @icon         https://www.google.com/s2/favicons?domain=traderie.com
// @grant        none
// ==/UserScript==

(function() {
    function add() {
    document.querySelector("#root > div.sc-eXlDFz.fmdpDr > div:nth-child(1) > div.product > div.container > div.product-action-bar > div:nth-child(1) > button").click();
}

function tickBox() {
    document.querySelector("#root > div.sc-eXlDFz.fmdpDr > div:nth-child(1) > div.product > div.container > div.create-listing > div:nth-child(5) > div.create-listing-checks > label:nth-child(2) > input[type=checkbox]").click();
}

function send() {
    document.querySelector("#root > div.sc-eXlDFz.fmdpDr > div:nth-child(1) > div.product > div.container > div.create-listing > div.create-listing-btn-bar > button").click();
    console.log("Complete");
}

function ok() {
    document.querySelector("#root > div.sc-eXlDFz.fmdpDr > div:nth-child(1) > div.product > div.container > div.create-listing-confirm > button").click()
}

var btn = document.createElement("BUTTON");
btn.innerHTML = "Add to listing";
document.body.appendChild(btn);
document.querySelector("body > button").style.position = "fixed";
btn.addEventListener('click', () => {
    add();
    setTimeout(tickBox, 1000);
    setTimeout(send, 1500);
    setTimeout(ok, 2000);
});



})();