/r/GreaseMonkey

Photograph via snooOG

If you make a Grease Monkey script for Reddit, post a link here.

/r/GreaseMonkey

4,221 Subscribers

0

Is there a tamper monkey script to do mastery tests on edmentum schools?

2 Comments
2025/01/28
04:06 UTC

5

Chrome extension to run GreaseMonkey script on a local server

I'd love to be able to use kind of "dotfiles" to configure my GreaseMonkey scripts on a new machine, or easily update them from my local folder rather than the clunky in-extension editor

Is there a kind of chrome extension I can use which would connect to a local server (that I could install locally on my laptop, linux box, etc) which would run the page through it before rendering it again, so that I can effectively inject my userscripts outside of Chrome (and therefore have them in a git repo, version them, etc)?

Tried to detail it a bit here: https://bsky.app/profile/maelp.bsky.social/post/3lgkmasnuls2d

2 Comments
2025/01/25
09:28 UTC

1

need help getting script to work please

I am very unexperienced in tampermonkey and browser scripts so i need help with this because its just not doing anything when i try to start the script

edit:heres the script sorry i thought i pasted it

https://greasyfork.org/en/scripts/32910-auto-answer-script

3 Comments
2025/01/25
06:03 UTC

1

Clicking a button that's not a button

I'd like to use Tampermonkey to automate downloading a CSV file of my Fidelity portfolio. The idea was to do something that looks like this:

document.getElementById("download_button").click();

But the button on Fidelity's webpage is something I've never seen before. I'm not a web-dev; never even heard of the "use" tag.

<use href="#pvd3pwe-nav__overflow-vertical" xlink:href="#pvd3pwe-nav__overflow-vertical"></use>

Inspector gives me a whole host of identifiers, like XPath (can't use Selenium since Fidelity always seems to know I'm scraping the website and punishes me by making me change my password):

//*[@id="posweb-grid_top-kebab_popover-button"]
    /s-root/button/div/span[1]/s-slot/s-fallback-wrapper/pvd-scoped-icon-75514896/svg/use

selector:

#posweb-grid_top-kebab_popover-button > s-root > button > div >
    span.pvd-button__icon.pvd-button__icon--left > s-slot > s-fallback-wrapper > pvd-scoped-icon-75514896
        > svg > use

You get the picture. This "button" opens up a sub menu, and one of these submenu items is "Downwload":

<button role="menuitem" id="kebabmenuitem-download" class="posweb-kebabmenu_item" data-key="download"
    data-menuitemtype="download" tabindex="-1">
    Download
</button>

I did try writing a TamperMonkey script that looked like this:

const aButton = document.getElementById('kebabmenuitem-download')
aButton.click()

but this didn't work for some reason. Maybe the website injects the submenu only after you click the first button? I suck at web-development, so I don't quite understand what's going on. Since IDs are unique, it feels like my script should work.

This is my first TamperMonkey script. Can someone please give me a push in the right direction?

6 Comments
2025/01/21
19:10 UTC

1

Script to remove "Today's Picks", "Recommended For You", and "Sponsored" sections from Roblox Home page?

I don't have much experience with CSS and google isn't helping me, title is self explanatory - need a script that removes just those sections from the home page while leaving everything else intact.

0 Comments
2025/01/14
07:37 UTC

2

Auto play next training video

I have to watch a bunch of training videos. I want to Auto play next training video or click next to especially when it wants to do a "skill check". I have been looking all day and I'm out of brain juice for today. Does anyone have an idea or hints? thank you.

3 Comments
2025/01/13
23:14 UTC

2

is there any way to deny youtube short closing PiP on scroll ?

it is so annoying pls help

3 Comments
2025/01/10
15:04 UTC

1

Script for Soundcloud search results

When you enter a search term for music on soundcloud, it used to play all the search results in order. However, now it plays a random song after you play the first search result.

I've been trying to find a solution online, and other people have this problem too. I've asked a few different AI assistants for help, and they suggested using a script with Tampermonkey. I installed the extension and copy pasted scripts the AI wrote me and explained to the AI that they didn't work. I did this about 10 times and none of the scripts worked.

Is it possible to fix this issue using Tampermonkey, or is there another method I could use?

0 Comments
2025/01/08
06:02 UTC

1

How Can I Tell When YouTube History Page is Done Loading?

Hello all,

I'm trying to create my first Greasemonkey script, to remove duplicate videos from a user's Youtube History page, but I'm having trouble getting it to run after the video HTML is loaded in. Tried multiple techniques so far, but none have worked.

Any advice? Thanks in advance!

PS: Even running simple JS on that page slows down the loading by a noticeable amount. Any way to avoid that as well?

1 Comment
2025/01/07
19:55 UTC

2

tampermonkey doesn't run my script

// ==UserScript==
// @name         remove premium problems
// @namespace    http://tampermonkey.net/
// @version      2025-01-06
// @description  try to take over the world!
// @author       You
// @match        https://*.leetcode.com/problemset/algorithms/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=leetcode.com
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    function mutationHandler(mutationRecords) {
        document.querySelectorAll("svg.text-brand-orange").forEach(e => e.parentElement.parentElement.remove());
        console.log("removed premium problems...");
    }

    function observeDomChange() {
        const myObserver = new window.MutationObserver(mutationHandler);
        const obsConfig = {
            childList: true, attributes: true, subtree: true
        };
        myObserver.observe(document, obsConfig);
    }

    observeDomChange();
    console.log("TAMPERING...");
})();

https://preview.redd.it/yb5dp6lu2abe1.png?width=814&format=png&auto=webp&s=44dc220dfd17b1e9f283d4c4b67c6e51f0498ca7

6 Comments
2025/01/06
01:41 UTC

0

Is this Sketchfab ripper legit?

I haven't used this before but does anyone know if this is safe or has worked? I would really appreciate it if someone could let me know.

https://greasyfork.org/en/scripts/492877-sketchfab

5 Comments
2025/01/05
02:03 UTC

1

I am available for making or editing scripts

This sub confuses me. Most of the threads are people asking others to make scripts for them? Which doesn't seem to be the "purpose" of the sub.... yet it's allowed. So in this spirit, I am offering my services to create or edit scripts for you. I can also do backend stuff if you need to get fancy or make your script send data somewhere else other than your personal browser. I know how to do all this for cheap or free (yes you can get free backend server hosting or host it yourself).

My rate is very low compared to most devs out there these days. I was getting paid 14 per hour in my day job before I got let go, so something comparable to that and I will be satisfied.

Anyways take care and I do have a website, but that's probably considered spam because it's an external link so I won't post it. You know how to contact me.

Thanks and take care and consider the low amount amount of money I'm potentially not making (less than 15) before hating this post because you don't want me to get paid 10 dorrah for making someone else's script or some other reason I guess? It's not fair to professional developers making 30k+ a year. Why don't I just beg for money without providing an actual service like a regular poor person and suffer in silence. I understand. Also if I dont respond in a while you can contact or submit your script request to gwen 500 (no spaces) at python anywhere dot you know what.

2 Comments
2025/01/04
21:11 UTC

2

Tampermonkey @require jQuery not working for Youtube script

So I switched browsers and noticed that my Youtube script is broken when I require jQuery.

There was this error "This document requires 'TrustedHTML' assignment". It was strange because in the old browser the same script worked.

It turned out in the previous browser I had also "Simple Youtube Age restriction bypass" script installed, which was handling the error above also for my script. So I installed it again on the new one and everything is fine now.

Adding this so it's indexed in Google and no one else wastes so much time figuring it out like me.

1 Comment
2025/01/04
19:56 UTC

0

tampermonkey scripts not loading in chrome browsers?

I know this is the subreddit for GreaceMonkey but I need help with tampermonkey as the scripts I usually use on firefox seem to not work on tampermonkey, please help as I need to get this fixed

11 Comments
2025/01/01
03:54 UTC

0

Click all buttons of a certain type in a specific section of a page

On a page like this one, I need to scroll down to the section between "Classes of subgroups up to conjugation" and "Series", make sure that the "profile" option is selected, and then click all of the subgroup names, which are blue and underlined. Clicking each one expands a table, which is where the info that I need is hiding.

The linked one wouldn't take much time, but it takes substantially more time for longer pages of this sort (which might have 500+ buttons to click).

I can provide the part of the HTML containing these clickables, if it helps. Thanks!

7 Comments
2024/12/31
20:05 UTC

2

Open images in new tab with one click | Disable lightbox

Hello. Is there any way to open images after just clicking them? Right now, I have to right-click to view the image, on its own, in a new tab. Previous UI let me just do that.

Example

What Iā€™d Like

3 Comments
2024/12/28
21:07 UTC

1

eBay Filter

Is it possible to make a Tampermonkey script so you can search on eBay for auctions ending soonest AND lowest price?

8 Comments
2024/12/28
15:01 UTC

2

Need a script to redirect youtube.com to youtube.com/tv#/

I want to use my pc as a streaming device for my pc and wanted a script to redirect the youtube videos to the youtube tv version. I have a chrome extension which enables the youtube tv so youtube.com./tv#/ opens the youtube in the android tv style ui.

original link: https://www.youtube.com/watch?v=E76CUtSHMrU

redirected link: https://www.youtube.com/tv#/watch?v=E76CUtSHMrU

so basically i just want to add tv#/ to my youtube.com links

4 Comments
2024/12/28
10:27 UTC

4

Default sort reddit to new

// ==UserScript==

// @name Redirect Subreddit to /new

// @namespace http://tampermonkey.net/

// @version 1.5

// @description Redirects subreddit home pages to /new, excluding all other paths.

// @author Your Name

// @match https://www.reddit.com/r/\*

// @grant none

// ==/UserScript==

(function() {

'use strict';

let lastUrl = window.location.href; // Track the last processed URL

// Function to check and redirect

function redirectToNew() {

let currentUrl = window.location.href;

// Avoid repeated processing for the same URL

if (currentUrl === lastUrl) return;

lastUrl = currentUrl; // Update last processed URL

// Regex to match only subreddit home pages (without any additional paths)

let subredditHomeRegex = /^https:\/\/www\.reddit\.com\/r\/[^/]+\/?$/;

// Exclude paths like /submit, /search, etc.

let excludedPaths = /(submit|search|settings|message|about|new|top|hot|rising|controversial|gilded|random)/;

if (subredditHomeRegex.test(currentUrl) && !excludedPaths.test(currentUrl)) {

// Redirect to the /new page

let newUrl = currentUrl.replace(subredditHomeRegex, currentUrl.endsWith('/') ? '$&new' : '$&/new');

window.location.replace(newUrl);

}

}

// Debounced observer callback

const observeUrlChange = (() => {

let timeout;

return () => {

clearTimeout(timeout);

timeout = setTimeout(redirectToNew, 100); // Debounce to reduce frequent execution

};

})();

// Observe URL changes using MutationObserver

const observer = new MutationObserver(observeUrlChange);

// Start observing changes to the `title` element (indicative of navigation in Reddit)

observer.observe(document.querySelector('title'), { childList: true });

// Initial check

redirectToNew();

})();

0 Comments
2024/12/27
04:16 UTC

1

Script to bypass Facebook/Instagram/TikTok login

Hi all, is there a script to bypass facebook/Instagram/TikTok login for Tampermonkey ?

Thanks a lot

5 Comments
2024/12/26
22:46 UTC

6

Add a filter to show only -70% discounted items in online shop

Hello,
InĀ FAB, you have 30%, 50% etc., discount assets mixed with 70% discount assets.
You have only one function: to hide all assets with no discount at all.
Unfortunately, this makes the search for 70% discounted asset a huge problem.

I found this line in F12 web inspection mode:
<div class="fabkit-Badge-label">-70%</div>

Is there a script to filter for assets which have this label?

I already tried the extensions below, but they break the website's pages. Probably due to the infinite scroll on FAB, where previously displayed assets are deleted from the temporary browser memory. Search Box with F3 is also broken in FAB.

https://chromewebstore.google.com/detail/filter-anything-everywher/jmandnadineideoebcmaekgaccoagnki

https://chromewebstore.google.com/detail/elementhider/jnbamieaacddlfcoanmbkclnpoafhmie

4 Comments
2024/12/24
15:58 UTC

1

How to make userscript match only once?

For my @match setting, I have "https://*/*" and I only want to run it once on page load. However it appears to run for each XHR call. For example, a random stack overflow page runs this userscript 11 times, presumably for each RPC (or maybe inner HTML).

Is there an way to match just the initial page load?

3 Comments
2024/12/23
00:12 UTC

0

Kahoot Autoanswer bot free script

heres a link to the script i wrote to autoanswer any text questions on kahoots

https://greasyfork.org/en/scripts/521431-kahootgpt

0 Comments
2024/12/23
00:12 UTC

3

How can I press my trigger key even if I'm typing?

So, whenever I'm typing and the insertion cursor appears, I can't press "Insert", the key I use to make a prompt show up.

Is there any way to use such key even if I'm typing?

A workaround is clicking outside the text input field, but this is very, very annoying.

Here's my script, thank you.

(function() {
    'use strict';

    const roles = {
        "doc": "",
    };

    const playerCoordinates = {
        "1": { x: "619px", y: "68px" },
    };

    const overlayImages = []; 

  
    function makeDraggable(img) {
        let offsetX, offsetY;

        img.addEventListener("mousedown", (e) => {
            offsetX = e.clientX - img.getBoundingClientRect().left;
            offsetY = e.clientY - img.getBoundingClientRect().top;

            
            function onMouseMove(e) {
                img.style.left = `${e.clientX - offsetX}px`;
                img.style.top = `${e.clientY - offsetY}px`;
            }

         
            function onMouseUp() {
                document.removeEventListener("mousemove", onMouseMove);
                document.removeEventListener("mouseup", onMouseUp);
            }

            document.addEventListener("mousemove", onMouseMove);
            document.addEventListener("mouseup", onMouseUp);
        });
    }

    // Listen for the Insert key and custom command for clearing images
    document.addEventListener("keydown", (e) => {
        if (e.key === "Insert") {  // this is the key
            const command = prompt("Enter command:");
            if (!command) return;

            const [playerNum, role] = command.split(" ");
            const imageUrl = roles[role.toLowerCase()];

            if (!imageUrl || isNaN(playerNum)) {
                alert("Invalid command!");
                return;
            }

            const coordinates = playerCoordinates[playerNum];
            if (!coordinates) {
                alert("Coordinates not found for this player!");
                return;
            }
            let img = document.createElement("img");
            img.className = "role-overlay";
            img.style.position = "absolute";
            img.style.top = coordinates.y;
            img.style.left = coordinates.x;
            img.style.width = "60px";  
            img.style.height = "60px"; 
            img.src = imageUrl;

            document.body.appendChild(img);
            overlayImages.push(img); 
            makeDraggable(img);
        }

      
        if (e.key === "Home") {
            overlayImages.forEach(img => img.remove()); 
            overlayImages.length = 0; 
            alert("All images cleared!");
        }
    });
})();
5 Comments
2024/12/20
00:11 UTC

1

Download to subdirectory

Can a user script save to a sub-directory of the Downloads directory? I know that Firefox extensions can so why should it not be possible with a user script?

2 Comments
2024/12/18
13:10 UTC

3

WebSocket to localhost?

It seems like grant GM_webRequest is for intercepting, a websocket.

So I'm trying to start my own websocket. But it's getting blocked by Content Security Policy.

WebSocket("ws://127.0.0.1");
socket_prompt.addEventListener("open", (event) => {
socket_prompt.send(data);
});

'grant unsafeWindow' doesn't seem to help.

Any suggestions?

1 Comment
2024/12/17
06:10 UTC

0

craftnite schematic reader

im using cheatnite2024 script for craftnite.io and im trying to use the //load function to load a .schem / .nbt / .schematic file but i think its broken here :

// @require https://greasyfork.org/scripts/475779-readschem/code/readschem.js?version=1253860

because this page where the readschem.js is linked to no longer exsists so when i try to use load command i get

userscript.html?name=CheatNite2024.user.js&id=ff7dfeca-fd67-4010-9c83-449d4747495d:872 Uncaught (in promise) ReferenceError: readBuildFile is not defined

at reader.onload (userscript.html?name=CheatNite2024.user.js&id=ff7dfeca-fd67-4010-9c83-449d4747495d:872:20)

if anyone can help me fix this i would be so appreciative.

0 Comments
2024/12/16
07:24 UTC

0

can bypass payment after trial?

https://preview.redd.it/7uxw095yw27e1.png?width=3018&format=png&auto=webp&s=885f7b7d089fe6c303917174441cac2cebd0d922

want to bypass this page and use free trial forever. is that possible?

this is meet alfred dot com website

4 Comments
2024/12/15
21:19 UTC

1

Script to shuffle the videos from a YouTube channel?

I'm getting a bit tired of YouTube's default sorting options like A-Z, Z-A, or release date; a random order would be much more enjoyable to discover old stuff but not exactly the oldest stuff.

1 Comment
2024/12/09
18:02 UTC

Back To Top