~ashie/userscripts

706a0afb152652eff8fe39cfbf39c264c0b0457e — Ash 7 months ago
initial commit
A  => LICENSE.txt +21 -0
@@ 1,21 @@
This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
software, either in source code form or as a compiled binary, for any purpose,
commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this
software dedicate any and all copyright interest in the software to the public
domain. We make this dedication for the benefit of the public at large and to
the detriment of our heirs and successors. We intend this dedication to be an
overt act of relinquishment in perpetuity of all present and future rights to
this software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <https://unlicense.org/>

A  => LICENSES/Unlicense.txt +9 -0
@@ 1,9 @@
This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <https://unlicense.org/>

A  => README.md +14 -0
@@ 1,14 @@
# Collection of personal userscripts

> _I don't know what userscripts are_

see the explanation at https://greasyfork.org

# Userscripts in this repo:

-   annas-archive.user.js [[direct
    link](https://git.ash.fail/userscripts/blob/master/annas-archive.user.js)|[greasyfork](https://greasyfork.org/en/scripts/494262-anna-s-archive-show-external-downloads)]:
    Automatically expands the external downloads section on
    https://annas-archive.org
-   github-disable-symbols.user.js [[direct link](https://git.ash.fail/userscripts/blob/master/github-disable-symbols.user.js)]|[greasyfork](#todo)
    Disables opening symbols on click in the Github code viewer.

A  => annas-archive.user.js +23 -0
@@ 1,23 @@
// ==UserScript==
// @name        Anna's Archive - Show External Downloads
// @namespace   https://ash.fail
// @match       https://annas-archive.org/md5/*
// @grant       none
// @version     1.0.0
// @author      https://ash.fail
// @license     Unlicense
// @description Automatically expands the external downloads section on httpss://annas-archive.org
// @downloadURL https://git.ash.fail/userscripts/blob/master/annas-archive.user.js
// @homepageURL https://git.ash.fail/userscripts
// @supportURL  https://ash.fail/contact.html
// ==/UserScript==

for (const el of document.getElementsByClassName("js-show-external")) {
    el.classList.remove("hidden");
}

for (const el of document.getElementsByTagName("a")) {
    if ((el.textContent === "show external downloads")) {
        el.classList.add("hidden");
    }
}

A  => github-disable-symbols.user.js +16 -0
@@ 1,16 @@
// ==UserScript==
// @name        Github - Disable Symbols
// @namespace   https://ash.fail
// @match       https://github.com/*/*/blob/*
// @run-at      document-start
// @grant       none
// @version     1.0.0
// @author      https://ash.fail
// @license     Unlicense
// @description Disables opening symbols on click in the Github code viewer.
// @downloadURL https://git.ash.fail/userscripts/blob/master/github-disable-symbols.user.js
// @homepageURL https://git.ash.fail/userscripts
// @supportURL  https://ash.fail/contact.html
// ==/UserScript==

localStorage.setItem('codeView.openSymbolsOnClick', 'false')

A  => static/annas-archive1.png +0 -0
A  => static/annas-archive2.png +0 -0
A  => wait-for-element.user.js +21 -0
@@ 1,21 @@
function waitForElement(selector) {
    return new Promise((resolve) => {
        let element = document.querySelector(selector);
        if (element) {
            return resolve(element);
        }

        const observer = new MutationObserver(() => {
            element = document.querySelector(selector);
            if (element) {
                observer.disconnect();
                resolve(element);
            }
        });

        observer.observe(document.body, {
            subtree: true,
            childList: true,
        });
    });
}