/r/GreaseMonkey
If you make a Grease Monkey script for Reddit, post a link here.
/r/GreaseMonkey
Every time I search for something on Youtube using Firefox the page with the results is full of links that include the pesky pp tracking parameter. I'm trying to write a Tampermonkey JS script to remove that parameter everywhere on those page after it's loaded but unfortunately it doesn't work. This is what I wrote so far:
// ==UserScript==
// @name Remove BS from YouTube links
// @namespace https://www.youtube.com
// @version 2024-05-16
// @description Remove BS from YouTube links
// @author SG
// @match https://www.youtube.com/*
// @match https://m.youtube.com/*
// @icon https://www.youtube.com/s/desktop/5ee39131/img/favicon.ico
// ==/UserScript==
(function() {
document.addEventListener("DOMContentLoaded", function() {
// get all links with the pp parameter
var links = document.querySelectorAll('a[href*=\\&pp\\=]');
// remove the pp parameters and update the links
for (var i = 0; i < links.length; i++) {
var url = String(links[i].href);
// get the first part of the url before the pp parameter
links[i].href = url.split('&pp=')[0];
}
});
})();
Any help?
Hi all,
I'm trying to run a script ONLY on "https://thing.website.com/account/A-BCDEFGHI/#/something/*"
But if I set MATCH to "https://thing.website.com/account/\*/#/something/*"
It just does not work. I've tried to match just https://thing.website.com/account/* and then use INCLUDE and EXCLUDE to ensure it matches with JUST /something/*, but it still matches on any /account/ pages.
Any help would be greatly appreciated.
.
The Link Copier with Redirects UserScript is designed to help you effortlessly copy all the links from a webpage, including those with redirects, directly to your clipboard. Whether you are a researcher, a developer, a marketer, or anyone who frequently needs to gather links, this script simplifies the process by automating the task and ensuring that you capture the final redirected URLs.
Alt+1
on any webpage.Alt+1
to start the link copying process.Alt+1
.If you encounter any issues or have suggestions for improvement, feel free to open an issue on our GitHub repository.
Download the Link Copier with Redirects script now and streamline your workflow!
The following // @match does not seem to work, it does not match https://search.something.custom/something/london any idea? is it because it is not https://search.something.com/something/london ?
// @match https://*something*/*
// @match https://*/*something*
I use Qutebrowser which has really good adblock, but not as good as Ublock Origin. It doesn't remove Reddit promoted posts which makes Reddit nearly unusable. Their used to be a script that would hide Reddit promoted posts, but it is now obsolete.
I am new to programming, and have barely touched Javascript, and I am wondering if someone would be willing to help me out with this.
I have a script that I want to run on an as-needed basis. I first set it to "@run-at context-menu", but some sites disable the context menu. I can use "GM_registerMenuCommand" to run from the extension menu, but it seems I need to change "@run-at" and run for every site.
Is there a way to access tampermonkey's context-menu items from the extension menu? Functionally, I'm looking for something like "@run-at extension-menu".
I'm using tampermonkey 5.1.0 on Firefox.
Thanks,
Will it still affect Although I got my AV Some of those userscripts r really fishy I stopped using tapermonkey,these days I just wait someone to crack things ,then I download those things,yeah but u can't get premium sites like quillbot,and what about RAT(remote access Trojan),does greasyfork verify those scripts?
I grabbed some code I found on StackOverflow that was very close to what I needed and tried to modify it, but it doesn't seem to do anything.
Was hoping someone here could tell me where I screwed up.
The want:
When you load certain docs from HPE's website under the "psnow" section, you get these headers and footers that take way too much space (for my tastes).
Example: https://www.hpe.com/psnow/doc/a00008180enw.pdf?jumpid=in_pdp-psnow-qs
If you add a parameter to the URL "hf=none", then these headers and footers go away and you get a much cleaner look.
Example: https://www.hpe.com/psnow/doc/a00008180enw.pdf?jumpid=in_pdp-psnow-qs?hf=none
I am wanting to check for hf=none and if it's not found as part of window.location.search, then I simply want to add it.
However, as you may know, you need to use ?hf=none if .search is empty, and you need &hf=none if .search is not empty and you are adding a 2nd/3rd/4th param.
Current NOT working Code:
// ==UserScript==
// @name Remove Header File from psnow
// @namespace http://tampermonkey.net/
// @version 2024-05-03
// @description Make all psnow URLs slimmer by removing the large header and footer
// @author Casper042
// @match https://www.hpe.com/psnow/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=hpe.com
// @grant none
// ==/UserScript==
function share_redirect() {
var new_url = false;
if (window.location.hash.length === 0 && window.location.search.length === 0) {
new_url = window.location.href+"?hf=none"
} else {
if (window.location.search.indexOf('hf=none') != -1) {
return false; // already found
}
if (window.location.search.length && window.location.hash.length) {
new_url = window.location.href.split('#')[0]+"&hf=none"+window.location.hash;
} else if (window.location.search.length === 0 && window.location.hash.length) {
new_url = window.location.href.split('#')[0]+"?hf=none"+window.location.hash;
} else {
new_url = window.location.href+"&hf=none";
}
}
if (new_url) {
window.location = new_url;
}
}
Stolen and modified from this source: https://stackoverflow.com/questions/15256977/how-can-i-add-a-parameter-to-a-url-and-then-reload-the-page-using-greasemonkey
I want this to happen on page load and redirect to the newly written URL immediately.
This could be from clicked links or new tabs/windows spawned in from an outside application.
I only want it to happen when the URL starts with https://www.hpe.com/psnow/
Thanks
I would like to remove all ratings 5.9 and below but I'm not sure how to do this. I've tried a lot of different code but the most I've managed to do is remove all ratings using:
$("div[style*='text-align:right;margin-right:3px;width:50px']").remove();
The html code where the ratings are stored is:
<a target="_blank" href="https://www.imdb.com/title/tt259711/"><img src="/pic/icon-imdb.png" height="16px" width="16px"> 6.9</a>
Each page has 100 films listed with ratings. Can anyone offer advice with this?
Image link:
https://www.reddit.com/media?url=https%3A%2F%2Fi.redd.it%2Fmdqabuwqkxxc1.jpg
Couldnt find in search bar, has anyone been able to figure out a way to send an email via GM or has any resources that might be helpful to look into? Thanks!
// ==UserScript==
// u/nameReddit Links Open in Same Tab
// u/namespaceultrabenosaurus.Reddit
// u/version1.8
// u/description Enforce `target="_self"` on links within Reddit posts and messages on desktop, delevoped for next chapter links on r/HFY.
// u/authorUltrabenosaurus
// u/licenseGNU AGPLv3
// u/sourcehttps://greasyfork.org/en/users/437117-ultrabenosaurus?sort=name
// u/matchhttps://www.reddit.com/r/*
// u/matchhttps://www.reddit.com/message/*
// u/matchhttps://old.reddit.com/r/*
// u/matchhttps://old.reddit.com/message/*
// u/iconhttps://www.google.com/s2/favicons?sz=64&domain=reddit.com
// u/grantnone
// u/downloadURL https://update.greasyfork.org/scripts/464674/Reddit%20Links%20Open%20in%20Same%20Tab.user.js
// u/updateURL https://update.greasyfork.org/scripts/464674/Reddit%20Links%20Open%20in%20Same%20Tab.meta.js
// ==/UserScript==
(function() {
'use strict';
if("https://www.reddit.com"==location.origin && -1<location.search.indexOf("share_id=")){
location.href = location.href.replace(location.search, '').replace("www.reddit.com", "old.reddit.com");
}
setTimeout(function(){
RemoveTargetFromLinks();
}, 1000);
})();
function RemoveTargetFromLinks(){
//console.log("RemoveTargetFromLinks", location.origin);
var links=null;
if("https://www.reddit.com"==location.origin){
links=document.querySelectorAll('div[data-test-id="post-content"] div.RichTextJSON-root p > a[target="_blank"], div.content div.md-container a[href*="www.reddit.com"]');
for (var lin in links) {
if (links.hasOwnProperty(lin)) {
links[lin].removeAttribute('target');
links[lin].setAttribute('target', '_self');
}
}
} else if("https://old.reddit.com"==location.origin){
links=document.querySelectorAll('div.content div.usertext-body a[href], div.content div.md-container a[href*="www.reddit.com"]');
for (var lin in links) {
if (links.hasOwnProperty(lin)) {
try{
var linClone=links[lin].cloneNode(true);
linClone.removeAttribute('target');
linClone.setAttribute('target', '_self');
//console.log(linClone.attributes.href);
if(-1==linClone.attributes.href.nodeValue.indexOf("/s/")){
if(-1<linClone.attributes.href.nodeValue.indexOf("//www.reddit.com")){
linClone.attributes.href.nodeValue = linClone.attributes.href.nodeValue.replace("www.reddit.com", "old.reddit.com");
}
if(-1<linClone.attributes.href.nodeValue.indexOf("//reddit.com")){
linClone.attributes.href.nodeValue = linClone.attributes.href.nodeValue.replace("reddit.com", "old.reddit.com");
}
if(-1<linClone.attributes.href.nodeValue.indexOf("//redd.it/")){
linClone.attributes.href.nodeValue = linClone.attributes.href.nodeValue.replace("redd.it", "old.reddit.com/comments");
}
}
links[lin].parentNode.insertBefore(linClone, links[lin]);
links[lin].remove();
}catch(e){
console.log(e);
}
}
}
}
}
Are there any recommendations for error handling?
A particular failure is that the script clicks a link or button but the webpage does not navigate to the next one because there is another field that needs input and was left blank.
Any recommendation on how to identify and prevent that so that the script does not keep clicking forever?
Accidentally uninstalled Tampermonkey and now I've lost all my scripts, and I was wondering if there is any way to get them back. I use brave, and was trying to find a backup of my profile but not sure where that would be? All my 000003.log files that I could find for Tampermonkey look like they were wiped also. I'm on windows 11. Any help here would be a life saver!
TLDR; I need a script that can do two separate clicks. I use a web based EMR (electronic medical records) and I need an automated way to clean out a clinical inbox that will select a radio button that says "send to staff for labeling" followed by a regular button that says "close and next." Then I can just let this run and clear out this annoying inbox.
Is something like this possible?
If you can create it, I will pay for it!
Thanks in advance.
Bitwarden doesn't offer any sort of "blacklist" feature, i.e. don't do anything on x, y, or z domain. You can whitelist, sure, but that's a couple hundred domains. A blacklist would be, like, two, and the developers have shown no willingness to even consider a blacklist feature - they just offer a workaround that sucks.
Can tampermonkey disable/enable a chrome extension? Could I use it to create my own blacklist-style functionality?
A couple of sites I use a lot recently updated their interface. Previously thumbnail images and article titles were standard links and ctrl-clicking operated as expected but the new design uses javascript interception instead so now they just open in the same window. This is incredibly annoying. It's probably a bandwidth saving exercise.
Unfortunately I can't just turn off JS as there is no alternate version of the sites so then the text and images don't link to the onward-page at all.
Is there a script that will find JS-click interception and open it in a new tab?
yea, yea, fucking pop ups, can fuck right off
// @match https://*.stackoverflow.com/*
waitForKeyElements ("div.onetrust-content-sdk", deleteNotX);
function deleteNotX (jNode) {
if (jNode.has("div.onetrust-content-sdk").length) {
jNode.remove ();
}
}
I need a script that clicks a button to sign in on a site called acellus, idk how to do it cuz its just a image but acts like a button. can anyone help?
Is there any scripts allowing me to download Youtube videos in various formats right on the website?
Have been using YoutubeDL untill it no longer works.
I'm seeking a solution for what is apparently a somewhat complicated problem. I use a password protected website at work which shows the status of shipping containers that we are responsible for picking up from a port. The current procedure is that when we know a container is due to become available, we continuously refresh the website, looking for the status to change from "not ready" to "ready".
So it seems to me that it should be possible to have an algorithm of some sort auto refresh the website, and then send an email when the change happens. I've made 2 attempts to pay for a solution on r/slavelabour to get either a script or browser extension to do this, but neither have worked.
One issue is that I can't give someone else the login credentials, but I have the complete website saved in both the "not ready" and "ready" status.
I'm looking for any and all suggestions.
Thank you
This user script for Tampermonkey blocks all unwanted popups on websites unless they originate from a predefined list of whitelisted domains. It's designed to enhance your browsing experience by preventing intrusive popups while allowing necessary ones from trusted sources. This script is ideal for users who frequently encounter annoying popups but still require functionality from certain trusted sites.
window.alert
, window.confirm
, and window.prompt
to prevent their misuse for displaying unwanted content.Create a new script
.Ctrl+S
.whitelist
array within the script to include or remove domains based on your specific needs.To add a new domain to the whitelist, simply append it to the whitelist
array in the script. For example, to add example.com
, you would modify the array like this:
const whitelist = [
'500px.com',
'adobe.com',
// other domains
'example.com' // newly added domain
];
Make sure to regularly update and manage your whitelist to fit your browsing habits and security preferences.
You can get the script on greasyfork here.
The "Stack Overflow Code Copy" Tampermonkey script enhances the Stack Overflow website by adding a convenient "Copy" button to each code block within the questions pages. This simple yet powerful functionality improves the user experience by allowing developers and other users to quickly and easily copy code snippets without having to manually select and copy the content.
You can obtain this script at Greasyfork
This script eliminates the need to manually select code text, which can be cumbersome and error-prone, especially with longer snippets or those that include special characters that might not select correctly.
By reducing the steps needed to copy code, this script saves time for users who are looking to quickly gather solutions from Stack Overflow and apply them directly to their projects.
Ensures that the entire code block content is copied exactly as is, without missing any parts or adding any extra whitespace or characters that sometimes occurs with manual copying.
Upon visiting a question page on Stack Overflow, the script automatically scans for code blocks (contained within <pre>
tags). For each code block found, it:
To use this script, follow these steps:
By enhancing Stack Overflow with this script, users can focus more on solving problems and less on the mechanics of transferring code, leading to a more productive and satisfying experience.
I was using this script for a while to help remove spoiler blurs since I personally find them annoying. It seams to not work now on reddit. I tried tweaking it myself but I'm not familiar with javascript so it didn't really work. Can someone help make a updated version of this script? Thanks!
Link to script: https://greasyfork.org/en/scripts/416091-reddit-spoiler-blur-remover
Nefarious URL Redirect Blocker is a Tampermonkey script that detects and stops URL redirections, ensuring that you stay on the original URL and avoid being redirected to unintended websites. It provides a seamless browsing experience by preventing unwanted redirects and keeping you on the webpage you initially visited.
The Nefarious URL Redirect Blocker script utilizes JavaScript to monitor URL changes and intercept redirection attempts. Here's a breakdown of how the script functions:
beforeunload
and popstate
events, which are triggered when a page is about to be unloaded or when the browser history changes (e.g., when navigating forward or backward).window.history.pushState()
, creating a new history entry.window.history.replaceState()
.To use the Nefarious URL Redirect Blocker script, follow these steps:
That's it! With the Nefarious URL Redirect Blocker script installed and active, you can browse the web without worrying about unwanted redirects. The script will silently work in the background, ensuring that you stay on the original URLs you visit.
You can get the script at greasyfork
Hello everyone.
Coud anybody please help me write a script automatically expand all the sentences in Vocabulary section at Engoo website?
Here is the sample link: https://engoo.com/app/lessons/business-business-situations-handling-customer-complaints/zv6sIjcvEee9Fh9qKijPIw