-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathamazon-order-tracking.js
More file actions
24 lines (24 loc) · 1.06 KB
/
amazon-order-tracking.js
File metadata and controls
24 lines (24 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// ==UserScript==
// @name Amazon Tracking Info in Order List
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Shows the tracking details in the order list page
// @author Sreevisakh
// @match https://www.amazon.in/gp/css/order-history*
// @match https://www.amazon.in/gp/your-account/order-history*
// @grant none
// @require https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js#sha256=9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=
// ==/UserScript==
$(document).ready(function() {
$(".shipment:not(shipment-is-delivered)").each(function(index, element){
const trackLink = $(element).find(".track-package-button span a").attr('href');
const iframe = document.createElement('iframe');
iframe.src = trackLink;
element.append(iframe);
$(iframe).hide();
$(iframe).on('load', function(){
const tracking = $(iframe).contents().find('.milestone-explanation').text();
$(element).find('.shipment-top-row').append(tracking);
});
});
});