From d7dfdba8dda34744ef973e0f2b724fe02a4c867e Mon Sep 17 00:00:00 2001 From: Dan Jones Date: Fri, 1 Oct 2021 22:34:01 -0500 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20clear-store?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- trakt.clear-store.user.js | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 trakt.clear-store.user.js diff --git a/trakt.clear-store.user.js b/trakt.clear-store.user.js new file mode 100644 index 0000000..83b177b --- /dev/null +++ b/trakt.clear-store.user.js @@ -0,0 +1,37 @@ +// -*- tab-width: 4; js-indent-level: 4; -*- +// ==UserScript== +// @name Trakt Storage Clearer +// @namespace danielrayjones +// @version 0.0.1 +// @description +// @author Dan Jones +// @match https://trakt.tv/users/*/progress* +// @grant none +// @require https://bowercdn.net/c/konami-code-1.3.2/src/jquery.konami.min.js +// ==/UserScript== + +/* global $, compressedCache, localStorage, MutationObserver */ +/* jshint esversion: 6 */ + +(function() { + 'use strict'; + + const clearStorage = () => localStorage.clear(); + + /* todo + $(window).konami({ + code: [80, 73, 67, 75], + cheat: clearStorage + }); + */ + + function addPickButton() { + const $leftNav = $('.subnav-wrapper .container .left'); + const $found = $leftNav.find('.clear-store'); + if (!$found.length) { + $leftNav.append('') + .find('.clear-store').on('click', clearStorage); + } + } + +})();