From d33670fb5712b93111d03ee3fed758586a427522 Mon Sep 17 00:00:00 2001 From: Dan Jones Date: Fri, 2 Dec 2016 09:59:35 -0600 Subject: [PATCH] Initial commit of giveaway --- giveaway.user.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 giveaway.user.js diff --git a/giveaway.user.js b/giveaway.user.js new file mode 100644 index 0000000..654b733 --- /dev/null +++ b/giveaway.user.js @@ -0,0 +1,29 @@ +// ==UserScript== +// @name Amazon Giveaway Listing Visited Remover +// @namespace danielrayjones +// @description Allow removal of visited links on Amazon Giveaway Listing +// @include https://giveawaylisting.com/ +// ==/UserScript== + +var hideVisited = function(evt) { + console.log(evt); +}; + +var script = document.createElement("script"); +script.setAttribute("src", "//ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"); +script.addEventListener('load', function() { + + window.$jq = jQuery.noConflict(); + $jq(document).ready(function() { + $jq('#giveaways').on('click', 'a[href*="amzn.to"]', function(evt) { + + var href = $(this).attr('href'); + localStorage[href] = "visited"; + + }); + + $jq('b:contains("Hide")').after(''); + $jq('#hide_visited').on('click', hideVisited); + }); +}, false); +document.body.appendChild(script);