Last active
March 31, 2021 17:35
-
-
Save happiness801/2b6092f6aecd9cad7c20f99ada49124a to your computer and use it in GitHub Desktop.
Remove Amazon cruft
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 Remove Amazon Cruft | |
// @namespace http://onai.net/ | |
// @version 0.1 | |
// @description Removes cruft from Amazon including the Cart side-bar | |
// @author Kevin Gwynn | |
// @match https://www.amazon.com/* | |
// @match https://smile.amazon.com/* | |
// @match https://*.amazon.com/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
// Make sure jQuery is available | |
var gen = 0;var act=function(){gen=1;var script=document.createElement('script');script.src='//code.jquery.com/jquery-1.11.0.min.js';script.type='text/javascript';document.getElementsByTagName('head')[0].appendChild(script);};(!window.jQuery)?act():1;setTimeout(function(){console.log('jQuery '+(gen?'loaded: ':'existing: ')+(window.jQuery?jQuery().jquery:'no jQuery/load failed'));}, 500); | |
var removeCruft = function() { | |
// Remove cart sidebar | |
console.log('KAG: Remove Amazon Cruft...'); | |
jQuery('#nav-flyout-ewc').remove(); | |
jQuery('.nav-ewc-persistent-hover').removeClass('nav-ewc-persistent-hover'); | |
jQuery('.nav-ewc-full-height-persistent-hover').removeClass('nav-ewc-full-height-persistent-hover'); | |
} | |
setTimeout(removeCruft, 1500); | |
setTimeout(removeCruft, 3500); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment