// ==UserScript== // @name ao3 hide bookmarks // @namespace https://greasyfork.org/en/users/800073-bellisk // @version 0.1.1 // @description permanently hide bookmarks created by specified users // @author bellisk // @include http://archiveofourown.org/works/*/bookmarks* // @include https://archiveofourown.org/works/*/bookmarks* // @grant GM.setValue // @grant GM.getValue // @grant GM.listValues // @grant GM.deleteValue // @downloadURL none // ==/UserScript== const bookmarks = document.querySelectorAll('li.short'); // interface let headerModule, blockLink, blockStyle; for (let i=0;iHide Bookmarks `; unblock.className = 'dropdown bookmarkblock'; let search = document.getElementsByClassName('primary navigation actions')[0].getElementsByClassName('search')[0]; search.parentNode.insertBefore(unblock, search); // block bookmarks function getBookmarkerName(liTag) { const byline = liTag.getElementsByClassName('byline')[0]; const bookmarker = byline.getElementsByTagName('a')[0]; return bookmarker.text; } function blockThisBookmarker(bookmark) { const bookmarker = getBookmarkerName(bookmark); GM.setValue(bookmarker, bookmarker); GM.setValue('last', bookmarker); } async function blockSelected(bookmarks) { const blocked = await GM.listValues(); for (let j=0; j