├── .editorconfig ├── .gitattributes ├── LICENSE.md ├── README.md └── scripts ├── AternosAntiAntiAdblock.user.js ├── CratesIoDocumentation.user.js ├── GTFOTrending.user.js └── NoMoreTwitterInterests.user.js /.editorconfig: -------------------------------------------------------------------------------- 1 | [*] 2 | charset = utf-8 3 | end_of_line = lf 4 | indent_style = tab 5 | insert_final_newline = true 6 | tab_width = 4 7 | trim_trailing_whitespace = true 8 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf 2 | 3 | # Guaranteed to be text 4 | *.js text eol=lf 5 | *.md text eol=lf 6 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Modified BSD License 2 | ==================== 3 | 4 | _Copyright © 2020, Lucy_ 5 | _All rights reserved._ 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright 11 | notice, this list of conditions, the following disclaimer, and 12 | any "meta" commentary within the source code. 13 | 2. Redistributions in binary form must reproduce the above copyright 14 | notice, this list of conditions and the following disclaimer in the 15 | documentation and/or other materials provided with the distribution. 16 | 3. Neither the name of the project maintainer nor the 17 | names of its contributors may be used to endorse or promote products 18 | derived from this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND 21 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 22 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL LUCY BE LIABLE FOR ANY 24 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 25 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 26 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 27 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Lucy's userscripts 2 | 3 | - ~~[Aternos Anti-Anti-Adblock](https://github.com/Absolucy/userscripts/raw/dev/scripts/AternosAntiAntiAdblock.user.js) - Get rid of Aternos' annoying full-page anti-adblock banner.~~ 4 | - This script is now **deprecated**, as it no longer works 5 | - [GTFOTrending](https://github.com/Absolucy/userscripts/raw/dev/scripts/GTFOTrending.user.js) - Configurably filtering for topics and descriptions on Twitter for Web's trending sidebar 6 | - ~~[NoMoreTwitterInterests](https://github.com/Absolucy/userscripts/raw/dev/scripts/NoMoreTwitterInterests.user.js) - Gets rid of the stupid "interests" on your Twitter for Web timeline (the "Follow Topic" crap)~~ 7 | - This script is now **deprecated**, as [Tweak New Twitter](https://github.com/insin/tweak-new-twitter) does everything it does and more 8 | - [crates.io documentation](https://github.com/Absolucy/userscripts/raw/dev/scripts/CratesIoDocumentation.user.js) - Adds a "documentation" button linking to docs.rs to the crates.io search! 9 | 10 | ## How to use 11 | 12 | Install [Violentmonkey](https://violentmonkey.github.io/) for your browser, and download/open the raw script. The extension should prompt for you to install it. 13 | 14 | Any issues related to non-Violentmonkey userscript plugins, such as Tampermonkey or Greasemonkey, will be ignored unless they can be replicated on Violentmonkey. 15 | 16 | ### Why not Tampermonkey / Greasemonkey? 17 | 18 | - Tampermonkey is proprietary software. It was open source on versions 2.9 and earlier, but it is not any more. 19 | - Greasemonkey is simply less capable than Tamper/Violentmonkey, last I checked. 20 | 21 | ## Licensing 22 | 23 | All userscripts are licensed under a modified [BSD-3-Clause](LICENSE.md) license unless otherwise specified. 24 | -------------------------------------------------------------------------------- /scripts/AternosAntiAntiAdblock.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Aternos anti-anti adblock 3 | // @description Kills Aternos' annoying full-page + timeout anti-adblock. 4 | // @version 1.0.3 5 | // @author Lucy 6 | // @copyright 2022, Lucy (absolucy.moe) 7 | // @license BSD-3-Clause; https://github.com/Absolucy/userscripts/blob/dev/LICENSE.md 8 | // @downloadURL https://cdn.jsdelivr.net/gh/Absolucy/userscripts@dev/scripts/AternosAntiAntiAdblock.user.js 9 | // @updateURL https://cdn.jsdelivr.net/gh/Absolucy/userscripts@dev/scripts/AternosAntiAntiAdblock.user.js 10 | // @source https://github.com/Absolucy/userscripts 11 | // @namespace https://github.com/Absolucy 12 | // @match *://aternos.org/* 13 | // @grant none 14 | // @inject-into page 15 | // @run-at document-start 16 | // @meta Trans rights are human rights. 17 | // @meta If you disagree with that, you have every right to fuck off and not use my scripts :) 18 | // ==/UserScript== 19 | 20 | const regex = 21 | /function ([A-Za-z]+)\(\)\s+\{\s+([A-Za-z]+)\s+\=\s*true\s*;\s*([A-Za-z]+)\(\)\s*;\s*}\s*let\s*[a-zA-Z],\s*[a-zA-Z]\s*;/; 22 | 23 | (function () { 24 | "use strict"; 25 | let old_atob = unsafeWindow.atob; 26 | unsafeWindow.atob = function (i) { 27 | let out = old_atob(i); 28 | unsafeWindow.console.log("Decoded: " + out); 29 | let find_function = regex.exec(out); 30 | if (find_function) { 31 | let function_name = find_function[1]; 32 | unsafeWindow.console.log( 33 | "Patching " + function_name + " to 'Function.prototype'" 34 | ); 35 | out = out.replace(function_name, "Function.prototype"); 36 | unsafeWindow.console.log("Patched: " + out); 37 | } 38 | return out.replace( 39 | ".addClass('fa-sad-tear');", 40 | ".addClass('fa-sad-tear'); return true;" 41 | ); 42 | }; 43 | })(); 44 | -------------------------------------------------------------------------------- /scripts/CratesIoDocumentation.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name crates.io documentation button 3 | // @description Adds a documentation button to every crate in the crates.io search! 4 | // @version 1.0.0 5 | // @author Lucy 6 | // @copyright 2022, Lucy (absolucy.moe) 7 | // @license BSD-3-Clause; https://github.com/Absolucy/userscripts/blob/dev/LICENSE.md 8 | // @downloadURL https://cdn.jsdelivr.net/gh/Absolucy/userscripts@dev/scripts/CratesIoDocumentation.user.js 9 | // @updateURL https://cdn.jsdelivr.net/gh/Absolucy/userscripts@dev/scripts/CratesIoDocumentation.user.js 10 | // @source https://github.com/Absolucy/userscripts 11 | // @namespace https://github.com/Absolucy 12 | // @match *://crates.io/search 13 | // @grant none 14 | // @run-at document-end 15 | // @meta Trans rights are human rights. 16 | // @meta If you disagree with that, you have every right to fuck off and not use my scripts :) 17 | // ==/UserScript== 18 | 19 | const CRATE_SELECTOR = 'a[href^="/crates/"]'; 20 | const QUICK_LINKS_SELECTOR = 'ul[class^="_quick-links"]'; 21 | 22 | // We need to wait until the search page loads. 23 | let interval_id = setInterval(() => { 24 | let crates = document.querySelectorAll(CRATE_SELECTOR); 25 | if (crates.length > 0) { 26 | clearInterval(interval_id); 27 | } 28 | crates.forEach((crate) => { 29 | let base = crate?.parentElement?.parentElement?.parentElement; 30 | if (!base) return; 31 | let crate_name = crate.innerText.trim(); 32 | let quick_links = base.querySelector(QUICK_LINKS_SELECTOR); 33 | if (!quick_links) return; 34 | let new_link = document.createElement("li"); 35 | let new_link_a = document.createElement("a"); 36 | new_link_a.href = `https://docs.rs/${crate_name}/*`; 37 | new_link_a.innerText = "Documentation"; 38 | new_link_a.target = "_blank"; 39 | new_link.appendChild(new_link_a); 40 | quick_links.appendChild(new_link); 41 | }); 42 | }, 100); 43 | -------------------------------------------------------------------------------- /scripts/GTFOTrending.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name GTFOTrending 3 | // @description Nuke annoying trends, such as celebrity garbage and Dream stan dumbassery, from the Twitter trending sidebar. 4 | // @version 1.1.2 5 | // @author Lucy 6 | // @copyright 2022, Lucy (absolucy.moe) 7 | // @license BSD-3-Clause; https://github.com/Absolucy/userscripts/blob/dev/LICENSE.md 8 | // @updateURL https://cdn.jsdelivr.net/gh/Absolucy/userscripts@dev/scripts/GTFOTrending.user.js 9 | // @downloadURL https://cdn.jsdelivr.net/gh/Absolucy/userscripts@dev/scripts/GTFOTrending.user.js 10 | // @source https://github.com/Absolucy/userscripts 11 | // @namespace https://github.com/Absolucy 12 | // @match *://twitter.com/* 13 | // @match *://*.twitter.com/* 14 | // @grant none 15 | // @meta Trans rights are human rights. 16 | // @meta If you disagree with that, you have every right to fuck off and not use my scripts :) 17 | // ==/UserScript== 18 | 19 | const description_filter_regex = 20 | /\b(dream|technoblade|techno|dreamsmp|georgenotfound|minecraft|epicsmp|epic smp|dream smp)\b/gim; 21 | const topic_regex = /\b(celebrity|k-pop)\b/gim; 22 | 23 | setInterval(function () { 24 | let trending = document.querySelector( 25 | "[aria-label='Timeline: Trending now']" 26 | ).firstChild; 27 | if (trending) { 28 | let node = trending.firstChild; 29 | while (node) { 30 | let inner_div = node.firstChild?.firstChild; 31 | if (inner_div) { 32 | let target; 33 | let topic = inner_div.children[0]?.children[0]?.children[0]; 34 | 35 | if (inner_div.children.length === 5) { 36 | target = inner_div.children[2]; 37 | } else if (inner_div.children.length === 4) { 38 | target = inner_div.children[1]; 39 | } else { 40 | target = inner_div; 41 | } 42 | 43 | if ( 44 | (target?.textContent && 45 | description_filter_regex.test(target.textContent)) || 46 | (topic?.textContent && topic_regex.test(topic.textContent)) 47 | ) { 48 | console.log("NUKING: " + target.textContent.toString()); 49 | node.remove(); 50 | } 51 | } 52 | node = node.nextSibling; 53 | } 54 | } 55 | }, 500); 56 | -------------------------------------------------------------------------------- /scripts/NoMoreTwitterInterests.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name NoMoreTwitterInterests 3 | // @description Gets rid of the stupid "interests" on your Twitter for Web timeline (the "Follow Topic" crap) 4 | // @version 1.0.4 5 | // @author Lucy 6 | // @copyright 2022, Lucy (absolucy.moe) 7 | // @license BSD-3-Clause; https://github.com/Absolucy/userscripts/blob/dev/LICENSE.md 8 | // @updateURL https://cdn.jsdelivr.net/gh/Absolucy/userscripts@dev/scripts/NoMoreTwitterInterests.user.js 9 | // @downloadURL https://cdn.jsdelivr.net/gh/Absolucy/userscripts@dev/scripts/NoMoreTwitterInterests.user.js 10 | // @source https://github.com/Absolucy/userscripts 11 | // @namespace https://github.com/Absolucy 12 | // @match *://twitter.com/* 13 | // @match *://*.twitter.com/* 14 | // @grant none 15 | // @meta Trans rights are human rights. 16 | // @meta If you disagree with that, you have every right to fuck off and not use my scripts :) 17 | // ==/UserScript== 18 | 19 | const TOPIC_PATH = 20 | "M18.265 3.314c-3.45-3.45-9.07-3.45-12.52 0-3.45 3.44-3.45 9.06 0 12.51 1.5 1.49 3.43 2.38 5.51 2.56v4.14c0 .31.2.6.5.7.08.03.17.05.25.05.22 0 .44-.1.59-.29l6.49-8.11c2.63-3.49 2.27-8.47-.82-11.56zm-10.56 7.87c0-.41.33-.75.75-.75h4.05c.41 0 .75.34.75.75s-.34.75-.75.75h-4.05c-.42 0-.75-.34-.75-.75zm8.6-3.24c0 .42-.34.75-.75.75h-7.1c-.42 0-.75-.33-.75-.75 0-.41.33-.75.75-.75h7.1c.41 0 .75.34.75.75z"; 21 | 22 | setInterval(() => { 23 | const elements = document.querySelectorAll( 24 | "svg.r-1janqcz.r-10ptun7, svg.r-14g73ha.r-1b94p3d" 25 | ); 26 | elements.forEach((node) => { 27 | if (node?.querySelector("path")?.getAttribute("d") === TOPIC_PATH) { 28 | let p = node.parentElement; 29 | while ( 30 | p.parentElement != null && 31 | p.tagName.toLowerCase() !== "article" 32 | ) { 33 | p = p.parentElement; 34 | } 35 | if (p.tagName.toLowerCase() === "article") { 36 | console.log(`NUKING TOPIC: ${p.textContent}`); 37 | p.remove(); 38 | } 39 | } 40 | }); 41 | 42 | const newStyleTopics = document.querySelectorAll( 43 | "a[href^='/i/topics/'][id]" 44 | ); 45 | newStyleTopics.forEach((node) => { 46 | let p = node.parentElement; 47 | while ( 48 | p.parentElement != null && 49 | p.tagName.toLowerCase() !== "article" 50 | ) { 51 | p = p.parentElement; 52 | } 53 | if (p.tagName.toLowerCase() === "article") { 54 | console.log(`NUKING NEW STYLE TOPIC: ${node.textContent}`); 55 | p.remove(); 56 | } 57 | }); 58 | }, 500); 59 | --------------------------------------------------------------------------------