1,346 questions
-8
votes
2
answers
105
views
How to automatically approve Perplexity GitHub Connector popups on the web UI?
I'm using Perplexity web UI (https://www.perplexity.ai/) with the GitHub Connector to automate code edits and commits. Every time I ask Perplexity to create/update files or make changes, an "...
0
votes
2
answers
183
views
User script append to DOM without having to reload page
I am working on a user script (I'm using Tampermoney as my user script manager) to append a dynamic Rotten Tomatoes link to a Jellyfin movies/series page.
It works when I manually reload on the title'...
2
votes
2
answers
202
views
In a userscript, how do you modify a react.js's click event to open the href in a new tab?
It took a lot of trial and error to figure out how to do this so I figured I would post my own answer. That said, I'd prefer a vanilla JS userscript. I've only figured out how to get this working with ...
2
votes
1
answer
195
views
How to achieve atomicity (and concurrency safety more generally) when accessing user script storage?
In modern user script managers, APIs available to access storage private to the user script, like GM.getValue and GM.setValue, are asynchronous. Since they are asynchronous, scripts using them are ...
1
vote
1
answer
90
views
How can I open a new page to specific text location?
I'm trying to implement a simple Tampermonkey userscript in my Firefox browser that searches a current window (containing lines of debug logs) for a URL, then opens this URL using window.open(url, '...
0
votes
0
answers
89
views
Every time I scroll down on reddit and make the posts float to the left, the view keeps going back to the top
screen recording
https://www.reddit.com/r/nextfuckinglevel/top/?t=month
// ==UserScript==
// @name REDDIT: gallery view
// @match https://www.reddit.com/*
// @require https://raw....
0
votes
0
answers
55
views
Tampermonkey userscript no longer picks up rating/tags on itch.io games listing
I’m using Tampermonkey on Chrome to hide itch.io games with average rating ≤ 3.0 or containing certain tags. Until recently I scraped data-ratings_avg and .game_tags a from each .game_cell. After a ...
0
votes
2
answers
146
views
How do I change the innerHTML of a newly created element watched by a Mutual Observer, WITHOUT causing memory leaks and freezes?
Imagine a website that has infinite scrolling, where a link saying download, appears underneath every post. I would like to change from a word to something else of anything else. (In my case a 24x24 ...
2
votes
2
answers
100
views
How to select the currently active / most recently focused video on a page with multiple videos?
On a page with multiple videos the currently active / most recently focused video reacts to standard keyboard actions like Space to play/pause the video or F to toggle full screen mode. This is ...
0
votes
0
answers
73
views
How to Reliably Extract Hidden Detailed Email Headers in Gmail using a UserScript?
I am developing a UserScript for Gmail to copy comprehensive email details, including the full header information (Sender, All Recipients, Date, Message-ID, 'mailed-by', 'signed-by', etc.).
The header ...
0
votes
1
answer
120
views
iOS WKWebView's addUserScript does not work first time for "about:blank"
I am able to demonstrate my issue using the below simple example.
I basically need to use the addUserScript to load different scripts based upon which website the web view has navigated to. This works ...
0
votes
0
answers
31
views
Chrome Extension UserScript Execute Without Refresh Page
Does anyone know a way to make a script registered with chrome.userScript execute immediately without having to refresh the page? In manifest v3 the accepted way to execute user script is through the ...
0
votes
1
answer
233
views
Automating clicks with userscript (tampermonkey)
I have a userscript for https://docs.google.com/forms. I'm trying to auto open the "Share" modal window and re assign all Editors to Responders.
To open the share modal this works:
function ...
0
votes
1
answer
74
views
Userscript for pasting content to Arqade (an SE site) comments always gets the error "No textarea found [...]"
I'm making a userscript for easy pasting of canned messages that we use on Arqade. However, every time I try to use it, I get the error:
No textarea found inside the target comment form.
What am I ...
0
votes
0
answers
40
views
Chrome: How to set navigation key focus on page start? (userscript or extension)
Background
Navigation keys (arrow, page-up/down) can be used to move element viewport, and user need to click the scrollable element to "focus" it.
However, the focus for this specific ...
1
vote
1
answer
105
views
Get namespace of current page MediaWiki userscript
So, I'm creating a Wikipedia user script, and for it, I need to get the current namespace and get a true or false value. I tried using wgCanonicalNamespace , but this did not work. Here is another ...
0
votes
0
answers
98
views
Is MutationObserver called for each DOM node insert or is the call batched?
I am trying to delete some scripts on page load via the use of TamperMonkey.
I am using MutationObserver to figure out when a script event loads and if so delete it and place my script on it.
// ==...
1
vote
0
answers
110
views
Blob download saves as .bin with a random filename instead of .webm
I'm developing a Tampermonkey userscript to capture audio from a webpage using the MediaRecorder API. The script successfully records audio and creates a Blob with the MIME type audio/webm;codecs=opus....
0
votes
0
answers
128
views
Why userscript cannot intercept all requests?
Similar to this question. The following userscript intercepts fetch and XMLHttpRequest requests and log their url's to the console. But, why it doesn't intercept all requests? for example it doesn't ...
1
vote
1
answer
68
views
Userscript to add characters before and after selection with a shortcut
I tend to use Chrome and MediaWiki's WikiEditor to add internal links, but it requires clicking on the respective button. Is there a way to either insert the characters with a shortcut or activate ...
0
votes
1
answer
98
views
What's the correct command in userscript to 'pull' a message from MQTT?
I had a friend set up an MQTT to trigger by Gmail emails with certain words, which I want to use to set a script (via userscript in Chrome) in motion with that trigger from the MQTT.
He set up the ...
-1
votes
1
answer
49
views
Looping over strings for use in document.evaluate() returns unexpected results
I am trying to reformat a webpage so that certain cells (td) are highlighted based on their values. I have several labels I'm looking for, and wanted to try to do this in a loop.
The "label"...
2
votes
1
answer
327
views
How to customize the seek backward/forward interval of the "ARD Mediathek" media player?
The default seek backward/forward interval of the ARD Mediathek media player using the arrow keys ← and → (or alternatively J and L) is very large depending on the video length (e. g. for a video ...
1
vote
0
answers
92
views
Userscript Can't Run on Google Search Console Pages?
I'm trying to create a script which will allow the exclusion of certain results on the "not indexed" page of Google Search Console, to alleviate reviewing things repeatedly.
Violentmonkey ...
1
vote
1
answer
344
views
How do I create a userscript that creates a button on a webpage, that when clicked, runs the GM_registerMenuCommand for that userscript?
I have a userscript that includes a GM_registerMenuCommand('Render LaTeX', () => { (and so forth) that makes part of the userscript only run when manually triggered by selecting the ViolentMonkey ...
0
votes
1
answer
59
views
How can I fix this userscript to work in a browser that has committed the inputs it uses to be its own shortcuts?
The idea of this userscript is that when browsing search results, you can hold different combinations of three keys to indicate whether that tag will be added to your search query with an AND, NOT or ...
0
votes
1
answer
52
views
Get text from nested DIV by contents of parent div
I am trying to extract some text from a webpage. I've tried something like:
var headings = document.evaluate("//div[contains(., 'Location')]", document, null, XPathResult.ANY_TYPE, null );
...
1
vote
1
answer
416
views
Creating a custom shortcut for Google Docs (Alt + P download as pdf)
I wrote the following script to download as PDF a Google Docs file; when I click Alt + P nothing happens. I'm using Google Chrome.
// ==UserScript==
// @name Google Docs PDF Download Shortcut
/...
1
vote
1
answer
73
views
UserScript Update Link According to Original Link
What I want is when I visit a specific website that all urls on the PAGE that match (example.com/view=list or example.com/view=card or example.com/view=posts etc..) are changed to:
example.com/view=(...
2
votes
1
answer
1k
views
Trying to hide an element using TamperMonkey userscript
Objective
I am trying to hide an element using Temper Monkey user script
The testing webpage is https://www.dmla5.com/play/8733-1-5.html.
After clicking the pink button, a video will be loaded.
My ...
1
vote
2
answers
158
views
How to focus YouTube search suggestions items?
I currently have this code. This opens the YT search in a new tab when you click the middle-mouse button:
(function() {
'use strict';
var searchIcon = document.getElementById("search-...
1
vote
1
answer
822
views
How to do a javascript fetch without being blocked by CORS policy? [duplicate]
I tried to run this javascript code on a Tampermonkey userscript on many webpages but they all gave the same problem: (I modified some details)
var data="744483"; var url="https://...
0
votes
0
answers
696
views
injecting javascript on samsung internet browser?
Is there any way to inject JS in websites on Samsung internet browser anymore? They patched bookmarklets a year ago as a "vulnerability" (So now you can't run javascript: bookmarks)
...
1
vote
1
answer
1k
views
userscript (violentmonkey) script runs on first page, does not run on subsequent pages
I am trying to make a userscript that will open the invoices from Amazon in new tabs, so that I can try to categorize my spending better. It's a PITA.
Here's the link:
https://www.amazon.com/cpe/...
1
vote
1
answer
87
views
How to make a Userscript redo all the actions in subsequent webpage navigations of the same URL?
I have a UserScript like the below:
document.querySelector('[title="Select: This option"]').checked = true
document.querySelector('[title="Click to continue"]').click()
After the '...
0
votes
1
answer
352
views
how to apply prefix- config to tailwind cdn before it runs in userscript?
// ==UserScript==
...
// @match */*
// @require https://cdn.tailwindcss.com
// @run-at document-end
// @grant none
// ==/UserScript==
(function() {
'use strict';
...
0
votes
1
answer
236
views
Userscript to style Shadow DOM elements of arbitrary website
This is my userscript to change the color of visited links. It is assumed to be able to work with any website.
// ==UserScript==
// @name Change the color of visited links
// @description -
// @...
1
vote
1
answer
170
views
@require http://code.jquery.com/jquery-latest.js outdated: How to refer always the newest jquery library?
See below
From a Greasemonkey/Tampermonkey script I want to refer/include always the newest jquery library.
Therefore I coded until now:
// @require http://code.jquery.com/jquery-latest.js
...
0
votes
1
answer
341
views
Why does MutationObserver not detect nodes after a random point?
I am building a Tampermonkey user script. My actual script is a lot more complex but I am able to reproduce with the following example.
My script needs to work on Hacker News website.
For example on ...
1
vote
0
answers
161
views
Run tampermonkey userscript on non existing page?
I want to run a tampermonkey script on a non existing page in firefox ("Page not found" - default page). The typical method I use to inject a payload like this does not work:
window....
0
votes
1
answer
64
views
Using Javacript, Button element properly selected but .click() happening though event successfully triggered
I am doing a Javascript userscript that can click on 'Voir plus' automatically on this webpage.
To select the button element 'Voir plus' I am using the great waitForElem function. This work great &...
2
votes
1
answer
118
views
How do I add a US dollar sign to currency numbers on a webpage using a userscript?
I am trying to add a $ sign to multiple currency values on a webpage that does not contain currency symbols.
For example, I would like 25.00 to be formatted as $25.00. Another example is that I would ...
1
vote
1
answer
85
views
Trying to create greasemonkey to check a box on a page
New greasemonkey user, I have put together this code to check a box name isRegex... but the check box code is skipped
console.log("Monkey script");
var chkBox,regBox;
var sQuery = "//...
0
votes
1
answer
54
views
Compare part of url with contents of div
One of the site i am using recently implanted suggestion search so currency showing so many unrelated trash.
Trying to hide all div that not contain part of url.
sample url pattern
https://urll.com/...
0
votes
1
answer
119
views
How to get precise position of HTML element after scrolling
I'm writing a tampermonkey script to add speed buttons next to Facebook videos. The script get all the video elements in the page, get their position, and bases on that position to place the button ...
1
vote
0
answers
452
views
use golang wasm in userscript(tampermonkey)
// ==UserScript==
// @name test
// @namespace http://tampermonkey.net/
// @version v1
// @description test
// @author test
// @match *://*/*
// @icon https://www....
0
votes
0
answers
49
views
How to trigger a JS function when the content of a page changes [duplicate]
I'm writing a script to be triggered every time the page loads more content, or as I understand, child nodes are added to the html of the page. I used to mutation observer to observe the div named ...
-1
votes
2
answers
92
views
Identify iframe with specific string in src
The target webpage sometimes contains a single embedded iframe video. I wish to open those specific videos in the current tab.
<iframe allowfullscreen="true" webkitallowfullscreen="...
2
votes
1
answer
183
views
Use previously cached selectors with querySelector()
How can I use previously cached selectors with certain aspects of querySelector() ?
For example, I have this HTML / JavaScript:
let L1, L2, L3;
L1 = document.querySelector('#L1');
L2 = L1....
1
vote
1
answer
1k
views
Using font-awesome CDN with Tampermonkey
// ==UserScript==
// @name Name
// @description Description
// @author You
// @version 0.1
// @match https://mysite*
// @resource customCSS https://cdnjs.cloudflare.com/...