├── README.md ├── manifest.json └── offerID.js /README.md: -------------------------------------------------------------------------------- 1 | # Amazon Offer ID Extension 2 | Adds a button to the Amazon DOM to copy the Offer ID of the product to your clipboard. 3 | 4 | Currently for Chrome browser only. 5 | 6 | # How to Manually Install Unpacked Extensions (Chrome): 7 | https://github.com/web-scrobbler/web-scrobbler/wiki/Install-an-unpacked-extension 8 | -------------------------------------------------------------------------------- /manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "manifest_version": 2, 3 | "name": "Amazon OfferID - IdekDude", 4 | "version": "1.0", 5 | "description": "Displays copy to clipboard OfferID button for Amazon.com items", 6 | "content_scripts": [ 7 | { 8 | "matches": [ 9 | "*://*.amazon.com/*" 10 | ], 11 | "js": [ 12 | "offerID.js" 13 | ] 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /offerID.js: -------------------------------------------------------------------------------- 1 | let data = document.getElementById("offerListingID") 2 | 3 | let offerID = data.value 4 | 5 | 6 | 7 | function copyText(){ 8 | var input = document.getElementById("twister-js-initializer_feature_div").appendChild(document.createElement("input")); 9 | input.value = offerID; 10 | input.select(); 11 | document.execCommand("copy"); 12 | input.parentNode.removeChild(input); 13 | } 14 | 15 | 16 | document.body.onload = addElement; 17 | 18 | 19 | function addElement(){ 20 | var OfferIDcopy = document.createElement("BUTTON"); 21 | OfferIDcopy.innerHTML = "Copy OfferID"; 22 | OfferIDcopy.addEventListener("click", copyText) 23 | 24 | OfferIDcopy.setAttribute("style","vertical-align: top; width: 90px; height: 40px; padding: 0; border-radius:2em; font-size: 14px; color: white; text-align: center; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); background: #2ecc71; border: 0; border-bottom: 2px solid #28be68; cursor: pointer; -webkit-box-shadow: inset 0 -2px #28be68; box-shadow: inset 0 -2px #28be68;") 25 | var element = document.getElementById("imageBlock"); 26 | element.prepend(OfferIDcopy) 27 | } 28 | --------------------------------------------------------------------------------