amazon subscribe and save button!!

adds a subscribe and save button to the left of the returns & orders button in the same style as the rest of amazon

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

Advertisement:

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

Advertisement:

// ==UserScript==
// @name         amazon subscribe and save button!!
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  adds a subscribe and save button to the left of the returns & orders button in the same style as the rest of amazon
// @author       Nicole_
// @match        https://www.amazon.com/*
// @icon         https://icons.duckduckgo.com/ip2/amazon.com.ico
// @license MIT
// @run-at       document-start
// ==/UserScript==
setTimeout(addbutton, 10)
setTimeout(addbutton, 20)
setTimeout(addbutton, 30)
setTimeout(addbutton, 40)
setTimeout(addbutton, 50)
setTimeout(addbutton, 100)
setTimeout(addbutton, 200)
document.addEventListener("DOMContentLoaded", function () {
    addbutton()
});
function addbutton(){
    let toprightbuttons = document.querySelector('.layoutToolbarPadding');
    if (toprightbuttons.innerHTML.includes("?ref_=nav_orders_first")){
        toprightbuttons.innerHTML = toprightbuttons.innerHTML.replace("/customer-preferences/edit?ie=UTF8&amp;preferencesReturnUrl=%2F&amp;ref_=topnav_lang", "/customer-preferences/edit").replace("https://www.amazon.com/gp/css/homepage.html?ref_=nav_youraccount_btn", "https://www.amazon.com/gp/css/homepage.html").replace('<a href="/gp/css/order-history?ref_=nav_orders_first" class="nav-a nav-a-2   nav-progressive-attribute" id="nav-orders" tabindex="0">\n  <span class="nav-line-1">Returns</span>\n  <span class="nav-line-2">&amp; Orders<span class="nav-icon nav-arrow"></span></span>\n</a>', '<a href="/gp/css/order-history" class="nav-a nav-a-2   nav-progressive-attribute" id="nav-orders" tabindex="0">\n  <span class="nav-line-1">Returns</span>\n  <span class="nav-line-2">&amp; Orders<span class="nav-icon nav-arrow"></span></span>\n</a><a href="/auto-deliveries/subscriptionList" class="nav-a nav-a-2   nav-progressive-attribute" id="nav-orders" tabindex="0">\n  <span class="nav-line-1">Subscribe</span>\n  <span class="nav-line-2">&amp; Save<span class="nav-icon nav-arrow"></span></span>\n</a>').replace('/gp/cart/view.html?ref_=nav_cart', '/gp/cart/view.html')
    }
};