Last active
October 14, 2024 04:56
-
-
Save AJolly/ff02d798f001057fb3de8b27096a84a5 to your computer and use it in GitHub Desktop.
Amazon Bypass Need anything else? Checkout UserScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Amazon Auto Checkout and No Thanks | |
// @version 0.2 | |
// @description Automatically clicks the "Continue to checkout" button on Amazon cart pages and "No Thanks" on product pages | |
// @match https://www.amazon.com/cart/byc/ref=ox_sc_byg_proceed* | |
// @match https://www.amazon.com/gp/product/* | |
// @namespace https://gist.github.com/AJolly | |
// @author AJolly | |
// @license MIT | |
// @downloadURL https://gist.github.com/AJolly/ff02d798f001057fb3de8b27096a84a5/raw/?cache-bust=112 | |
// @updateURL https://gist.github.com/AJolly/ff02d798f001057fb3de8b27096a84a5/raw/?cache-bust=112 | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
// Function to click the "Continue to checkout" button | |
function clickCheckoutButton() { | |
const checkoutButton = document.querySelector('a[name="sc-byc-ptc-button"]'); | |
if (checkoutButton) { | |
checkoutButton.click(); | |
console.log('Auto-clicked the "Continue to checkout" button'); | |
} else { | |
console.log('Checkout button not found'); | |
} | |
} | |
// Function to click the "No Thanks" button on product pages | |
function clickNoThanksButton() { | |
const noThanksButton = document.querySelector('#attachSiNoCoverage'); | |
if (noThanksButton) { | |
noThanksButton.click(); | |
console.log('Auto-clicked the "No Thanks" button'); | |
} else { | |
console.log('No Thanks button not found'); | |
} | |
} | |
console.log('AMZ Proceed and No Thanks Script Loaded'); | |
// Determine which function to run based on the current URL | |
if (window.location.href.includes('/cart/')) { | |
// Run the checkout function when the page is fully loaded | |
window.addEventListener('load', clickCheckoutButton); | |
// Also run the checkout function immediately in case the page is already loaded | |
clickCheckoutButton(); | |
} else if (window.location.href.includes('/gp/product/')) { | |
// Run the No Thanks function when the page is fully loaded | |
window.addEventListener('load', clickNoThanksButton); | |
// Also run the No Thanks function immediately in case the page is already loaded | |
clickNoThanksButton(); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment