Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save westonganger/49d351fd7c6876147736a7c8fe686ab2 to your computer and use it in GitHub Desktop.

Select an option

Save westonganger/49d351fd7c6876147736a7c8fe686ab2 to your computer and use it in GitHub Desktop.
TamperMonkey - Amazon orders page grand total script
// ==UserScript==
// @name Amazon page total
// @namespace http://tampermonkey.net/
// @version 2026-02-12
// @description try to take over the world!
// @author You
// @match https://www.amazon.ca/your-orders/orders*
// @icon https://www.google.com/s2/favicons?sz=64&domain=amazon.ca
// @grant none
// ==/UserScript==
(function() {
'use strict';
var prices = Array.from(document.querySelectorAll("span"))
.filter(function(el){ return el.textContent.includes("Total") })
.map(function(el){ return el.parentElement.nextElementSibling.querySelector("span").textContent })
.map(function(text){ return Number(text.replace("$", "")) });
var sum = 0;
prices.forEach(function(x){
sum = sum + x;
});
document.querySelector('.your-orders-content-container').insertAdjacentHTML('afterbegin', `<h1>ORDER PAGE TOTAL: $${sum}</h1>`);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment