-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathamazonsmile_reminder.user.js
33 lines (31 loc) · 1.22 KB
/
amazonsmile_reminder.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// ==UserScript==
// @name AmazonSmile Reminder
// @namespace http://tampermonkey.net/
// @version 0.2
// @description Reminds you to switch to AmazonSmile
// @author Raymond Chee
// @match https://www.amazon.com/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
// Your code here...
var navBar = document.getElementsByClassName("nav-right");
if (navBar) {
var smileDiv = document.createElement("div");
smileDiv.style.cssText = "margin-top: 8px; line-height: 40px;";
var smileSpan = document.createElement("span");
smileSpan.textContent = "Don't forget to purchase from ";
smileSpan.style.cssText = "vertical-align: middle; color: #ccc";
smileDiv.appendChild(smileSpan);
var smileLink = document.createElement("a");
smileLink.href = new URL(window.location.href);
smileLink.hostname = "smile.amazon.com";
var image = document.createElement("img");
image.src = "https://github.com/rjchee/my-userscripts/raw/master/Amazon_Smile_logo.png";
image.height = 40;
smileLink.appendChild(image);
smileDiv.appendChild(smileLink);
navBar[0].appendChild(smileDiv);
}
})();