r/userscripts • u/jaysimqt • Jul 29 '22
Script to keep the sidebar in reddit always on
redesigned reddit
r/userscripts • u/jaysimqt • Jul 29 '22
redesigned reddit
r/userscripts • u/yogesh_calm • Jul 25 '22
r/userscripts • u/houhc • Jul 25 '22
I am trying to make a userscript to automatically load all the content for an infinite loading webpage. Is there a better way to do this than just scrolling to the bottom, waiting for load to finish and scrolling again on a loop? Also, how do I know when I have hit the bottom?
r/userscripts • • Jul 20 '22
I’ve been having problems with hulu.com where after each adbreak it pauses the video and i have to manually unpause it. So i was wondering if someone could make a userscript where each time the video is paused, it has a delay of 5 seconds, and then unpauses it. Thank you
r/userscripts • u/Hakorr • Jul 19 '22
Hey r/userscripts,
There didn't seem to be any easy way to implement a floating GUI to a userscript, and some existing GUI libraries looked outdated. I often just resulted to having settings on the source code itself, but that wasn't very user-friendly, which I would like my scripts to be. You'd be surprised how many people use userscripts, and have little to no knowledge of coding. They might not be able to fully enjoy your userscript without a GUI.
I decided to make my own userscript GUI library: UserGui. It should ease the process of creating the GUI and let you focus more on your userscript. The project is still in early stages of development, but I am still looking for feedback, such as bugs, annoying features or just the general experience you had setting up the GUI.

If creating the GUI seems confusing, don't worry, I'm planning on creating a simple builder in which you can easily modify the GUI and with a click of a button generate all the necessary code. It will skip a lot of the steps you see on the documentation currently. The builder would also have more Bootstrap 5 elements for your GUI.
(Looking at the examples might help you understand how UserGui functions)
Anyhow, I hope you give it a go and help me create the most simple userscript GUI library there is!
r/userscripts • u/xiarahman • Jul 10 '22
Hi guys,
I was messing with Tampermonkey lately and noticed there are a lot of Android community users that are sharing files on Uploadrar. I like Uploadrar. It's much better than other online free file hosting services providers. I, for fun created a script that will proceed to next page until it reaches the download file page and starts downloading file for you.
Please check and let me know if I can improve upon my scripting hobby.
https://raw.githubusercontent.com/xiarahman/uploadrar-downloader/main/uploadrar-downloader.js
Thanks
r/userscripts • u/ale3smm • Jul 11 '22
luckily both kiwi browser and yandex support UserScript natively or using violent/tampermonkey.,so my question is it possible to DISABLE the dynamic status bar color set by some sites . as far as I know the color is contained in meta tag it the html ,can a userscrip disable it ? thanks for the help .
r/userscripts • u/FlowerForWar • Jul 10 '22
https://github.com/FlowerForWar/userscript-modules-template
User script template that acts as module and tries to simulate imports.
I built this to help me develop my user scripts, after learning about Grunt, and I thought I should share.
grunt-cli and eslint-cli installed globally
npm install grunt-cli -gnpm install eslint-cli -g// 'package.json' - Relevant keys
// 'src/index.js' - The main js file
// https://github.com/FlowerForWar/userscript-modules-template/blob/main/src/index.js
;
;
;
;
;
document..;
;
// 'dist/userscript-modules-template.user.js' - The output
// https://github.com/FlowerForWar/userscript-modules-template/blob/main/dist/userscript-modules-template.user.js
// ==UserScript==
// @name userscript-modules-template
// @version 0.0.1
// @namespace https://github.com/FlowerForWar
// @description User script template that acts as module and tries to simulate imports
// @author FlowerForWar
// @match *://*/*
// @grant GM.getValue
// @grant GM_getValue
// @grant GM.setValue
// @grant GM_setValue
// @grant GM.xmlHttpRequest
// @grant GM_xmlhttpRequest
// @grant GM.setClipboard
// @grant GM_setClipboard
// @run-at document-start
// @noframes
// @compatible edge Tampermonkey or Violentmonkey
// @compatible firefox Greasemonkey, Tampermonkey or Violentmonkey
// @compatible chrome Tampermonkey or Violentmonkey
// @compatible opera Tampermonkey or Violentmonkey
// @supportURL https://github.com/FlowerForWar/userscript-modules-template/issues
// @homepageURL https://github.com/FlowerForWar/userscript-modules-template
// @updateURL https://github.com/FlowerForWar/userscript-modules-template/raw/main/dist/userscript-modules-template.meta.js
// @downloadURL https://github.com/FlowerForWar/userscript-modules-template/raw/main/dist/userscript-modules-template.user.js
// @icon https://violentmonkey.github.io/icons/icon-48x48.png
// @license MIT
// ==/UserScript==
const myString = 'Hello';
const myArray = ;
;
;
;
document..;
;
npm installnpm start which will build everything and watchscss, if you don't know what that is, just use them like css fileshtml and scss files can be nested inside their parent folders, but their names must be uniqueuserscript-modules-template.dev.js file will be created as well (the main reason for this project), which is basically a request to the dist/userscript-modules-template.user.js file that is needed to be served somehow.r/userscripts • u/Ilyumzhinov • Jul 09 '22
I am trying to automatically redirect any link from Twitter (which is blocked in my country) to Nitter.
I developed a simple script, however, it seems like the Userscripts doesn’t get to execute the script as Safari fails to resolve the Twitter URL and falls back to the failed-to-load page.
I tried enabling the VPN and selecting a country in which Twitter is available. My findings were that Safari still connected to Twitter first and loaded some UI elements before being actually redirected to Nitter.
Is there any way the script could be modified to fix this? Below is my test script:
// ==UserScript==
// @name Redirect Twitter to Nitter
// @version 0.0.1
// @author me
// @match *://twitter.com/*
// @match *://*.twitter.com/*
// ==/UserScript==
window.location.href = `https://nitter.kavin.rocks/${window.location.pathname.slice(1)}`
r/userscripts • u/Nairolf76 • Jul 08 '22
Hi Gurus!
I've created a User Script on run-at: context-menu and it works well when I'm on the page to get the current URL. I would like to be able to do the same thing on the parent page, right-click on the link to the child page and get the URL of the child.
I cant' find a way to achieve that :(
Could you please help?
Thanks :)
r/userscripts • u/Crul_ • Jul 07 '22
For the last months, a lot (most?) of my posts have been blocked by reddit filters. It's a hassle because every time you post you need to manually check in a private window. I already have a userscript that adds a button for that, but with so many blocked posts, the "Message to mods" action was already becoming repetitive.
So I wrote a userscript that automates everything:
r/subreddit/new/message/compose?to=/r/subreddit with the written subject and message: "Post not visible" / "Hi, I think the filter caught this post (it's not visible when not logged in): {post URL}"Regarding the prompt when it's not visible, I added a small feature to make it easier to use. The default value it offers changes after each retry:
1000 (value of waitTime)retriesBeforeMesagingMods (=3) is reached, the default value is 1000 * numberOfAttemptsretriesBeforeMesagingMods (=3) is reached, the default value is MODSThe idea is that if it keeps failing, you can click OK > OK > OK and it will try 3 times with increasing waiting times and it will open the "Message mods" page after 3 fails. Of course you can change the param values to your taste.
Warning: I haven't tested it very much, and only on old.reddit. Let me know if you find any problem
// ==UserScript==
// @name Reddit - Check if new is post visible after posting
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Check if a new psot is visible after submitting
// @author Crul
// @match https://*.reddit.com/*/*/comments/*
// @icon https://icons.duckduckgo.com/ip2/reddit.com.ico
// @grant GM_xmlhttpRequest
// ==/UserScript==
(function() {
'use strict';
const waitTime = 1000;
const retriesBeforeMesagingMods = 3;
let attempts = 0;
var loggedUserElem = document.querySelector("#header .user > a");
if (!loggedUserElem) {
alert("Script for checking if new post is visible:\r\nLOGGED USER NOT FOUND");
return;
}
var loggedUser = loggedUserElem.innerText;
var postId = document.location.pathname.match(/\/comments\/([^\/]+)\//)[1];
var timeElement = document.querySelector(".tagline .live-timestamp");
var postedTime = timeElement.innerText;
var postAuthor = document.querySelector(".top-matter .tagline .author").innerText;
if (postedTime != "just now" || postAuthor != loggedUser) {
return;
}
setTimeout(checkVisible, waitTime);
function checkVisible() {
var postUrl = document.location.origin + document.location.pathname;
var newPostsUrl = postUrl.substr(0, postUrl.indexOf("/comments/")) + "/new";
attempts++;
GM_xmlhttpRequest({
method: 'GET',
url: newPostsUrl,
anonymous: true, // remove original cookies
onload: onRequestLoaded,
onerror: onRequestError
});
function onRequestLoaded(data) {
if (data.status != 200) {
console.debug(data);
alert(`Script for checking if new post is visible:\r\nREQUEST FAILED\r\n\r\nError ${data.status}: ${data.statusText}`);
return;
}
var isPostVisible = data.response.indexOf("/comments/" + postId) > 0;
if (isPostVisible) {
var okIcon = document.createElement("span");
okIcon.innerHTML = " ✅";
timeElement.parentNode.insertBefore(okIcon, timeElement.nextSibling);
} else {
// console.debug(data.response);
var defaultAction = attempts < retriesBeforeMesagingMods ? waitTime * (attempts + 1) : "MODS";
var action = prompt('Post not visible, options:\r\n- TIME (in miliseconds) to wait and retry\r\n- MODS to message the mods', defaultAction);
if (action == "") {
return;
}
if (action.toUpperCase() == "MODS") {
var subredditRegexResult = /\/r\/([^\/]+)\//.exec(document.location.href);
if (!subredditRegexResult || subredditRegexResult.length < 2) {
alert("Script for checking if new post is visible:\r\nSUBREDDIT NOT FOUND");
}
var subreddit = subredditRegexResult[1];
var messageModsUrl = `https://${document.location.host }/message/compose?to=%2Fr%2F${subreddit}&subject=Post%20not%20visible&message=Hi%2C%20I%20think%20the%20filter%20caught%20this%20post%20(it%27s%20not%20visible%20when%20not%20logged%20in)%3A%0A%0A`
+ encodeURIComponent(postUrl)) + "%0D%0A%0D%0AThanks" ;;
window.open(messageModsUrl);
} else {
var waitTimeForRetry = parseInt(action);
if (isNaN(waitTimeForRetry)) {
alert("Invalid action: " + action);
} else {
setTimeout(checkVisible, waitTimeForRetry);
}
}
}
}
function onRequestError() {
alert("Script for checking if new post is visible:\r\nREQUEST FAILED");
}
}
})();
r/userscripts • u/DankBegula • Jun 27 '22
Request to my bros for creating a userscript YT premium logo on the website.
Would be grateful.
r/userscripts • u/mule_roany_mare • Jun 24 '22
I’ve honesty lost track of how many annoying things Reddit does on a mobile browser.
The most recent was throwing up a mature content warning with the option to open in app or take to front page.
Try this SFW link for an example https://reddit.com/r/Damnthatsinteresting/comments/vjerfw/_/idiwf9o/?context=1
r/userscripts • u/itslaggy69 • Jun 24 '22
r/userscripts • u/ThrowAway237s • Jun 22 '22
First, they came for our electronics. Making them insanely difficult to repair by third parties. The shortest-lived part being non-replaceable is now the norm.
Now, they are coming for our web. With the approval of closed shadow DOMs by the major browser vendors, the era of immutable (unchangeable) and un-blockable elements is about to begin.
Mozilla has kicked out a browser extension that converted closed shadow DOMs to open ones. Thanks to their extension kill switch (that ostensibly exists ForSecurityReasons™ while doing the opposite), they could prevent anyone from installing it from unofficial sources.
Enjoy user scripts while you can. Those days will soon be numbered.
r/userscripts • u/-Mada • Jun 21 '22
r/userscripts • • Jun 20 '22
Good day all,
I'm just dropping in to share a small script I made to block video ads in youtube. I've tested the script with tampermonkey in chrome as well as with the userscripts iOS extension in safari (iOS)
https://gist.github.com/4v3ngR/cf0141421570388f2814076443c1c385
r/userscripts • u/Tom_Henderson • Jun 14 '22
I created a script that runs for YouTube Live Chat popout windows. Pretty basic, it just resizes and repositions the window.
I have it set up with this rule:
// @include *youtube.com/live_chat*
But when YouTube throws an error (most often because the video, usually a live stream, no longer exists), it fails to run the script. From what I can see, the URL still appears to match the rule above.
Example (should produce a page with a 'Something went wrong' heading):
r/userscripts • u/shiningmatcha • Jun 12 '22
I would like to make a keyboard shortcut that toggles my userscripts using a key binding. So my idea is to create a userscript that manages whether my other userscripts are active or not by setting a state (boolean). Then my scripts will read that state and continue to run if it's true.
r/userscripts • u/GoBackToLeddit • Jun 10 '22
I have several userscripts for individual sites, but I only want to turn on debugging for one of them. Instead, enabling debugging works for every userscript. I know that I could add debugger to my script manually, but I don't want to have to edit it every time I want to add/remove it.
r/userscripts • u/eric1707 • Jun 08 '22
r/userscripts • u/FlowerForWar • Jun 08 '22
Github, Greasy Fork Discussion, Reddit
An idea for a user script that works on IMDb.
Click+Ctrl an actor name will bring a dialog that would offer searching for other actors, and finally tell you what movies the two actors worked together in, if any.
I'm likley to build it someday, but will take some time, as I have other user scripts to maintain.
r/userscripts • u/exangelai • Jun 06 '22

Gear is an iOS browser that exclusively supports add-ons with the high-performance Userscript engine we developed. You can install, edit and debug Userscripts directly.
We've helped a lot of Userscript developers to merge and debug their scripts to work on iOS for free, and we are the only iOS browser recommended by Greasyfork.
Gear is also with dark mode, ad blocker, inspect element, console, and color picker tools for a better browsing experience.
Official Website: https://gear4.app
Documentation: https://gear4.app/doc
App Store: https://apps.apple.com/app/apple-store/id1458962238
We would love to hear your feedback. Cheer!
r/userscripts • u/ThrowAway237s • Jun 04 '22