userscript | Greasemonkey 脚本
kandi X-RAY | userscript Summary
kandi X-RAY | userscript Summary
Greasemonkey 脚本
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of userscript
userscript Key Features
userscript Examples and Code Snippets
Community Discussions
Trending Discussions on userscript
QUESTION
I have a GreaseMonkey user script that injects some HTML code into a page, and the HTML code is containing some JavaScript which points to an external script, which requires Google Analytics to work. To "bypass" Content Security Policy i injected this code just before :
...ANSWER
Answered 2021-Jun-07 at 20:48It's unclear what you want to achieve. It does not make any sense to change the tag script based in the DOM. Just don't set it in the first place or set it according to your needs.
QUESTION
I'm generating two files, userscript.meta.js
and userscript.user.js
. I need the output of userscript.meta.js
to be placed at the very beginning of userscript.user.js
.
Add-Content
doesn't seem to accept a parameter to prepend and Get-Content | Set-Content
will fail because userscript.user.js
is being used by Get-Content
.
I'd rather not create an intermediate file if it's physically possible to have a clean solution.
How to achieve this?
...ANSWER
Answered 2021-Jun-05 at 17:52$(
(Get-Content userscript.meta.js -Raw)
(Get-Content userscript.user.js -Raw)
) | Out-File userscript.user.js
QUESTION
I'm looking for a browser addon, userscript or some simple way that would display the URL of a link on the mouse position instead of the bottom left corner, like this for example.
Edit: It was easier than I thought, got it working with an one line userscript.
...ANSWER
Answered 2021-Jun-04 at 15:28Not sure exactly whats your requirement but seems you are looking for some title. Can you try with this:
QUESTION
I want to change the values of the buttons on the page with Tampermonkey, but I can't change it because it says the button is undefined?
HTML part
...ANSWER
Answered 2021-May-31 at 04:44I have modified your changeSpeed
function. It tries to select the buttons at 1 second interval (you might want to update this interval). If found clearInterval
is called and the rest of the code is executed.
QUESTION
Trying to write a userscript for TamperMonkey to be running in browser for bypassing a waiting time as a training. Here is the script used in that page:
...ANSWER
Answered 2021-May-20 at 14:51The variables you declare in your userscript are not referenced at all in the page's script, so I don't know what you're expecting the userscript to affect.
Since the page's script retrieves the seconds remaining from a .seconds
element, you can modify that element to remove the timeout:
QUESTION
I am a user of this website. The reason that I want to get elements of the website is its web design is so inconvenient that I tried to write a script, not manully, to modify some elements' value. But I encountered an issue that I cannot access an element by getElementsByName("name")
or getElementById("name")
UNTIL I inspect the element by CTRL + SHIFT + C
in developer mode. BTW, I can't get Elements even after inspecting on Firefox ESR 78.10.1
.
You guys can tried to see what is the problem. This is the screenshot on Edge Chromium as I try to get the username .
As I have researched, some says the page is not fully loaded, but I wrote this js to test if it is loaded.
...ANSWER
Answered 2021-May-18 at 08:59In Chrome, it has a nice feature when using the console if you select an iFrame it will target this for the document. It looks like in Firefox is does not have this feature.
If your wanting to do this with code you will basically need to do the same thing as Chrome.
Also if you always want to select the same thing, you may also want to do window.top
to also make sure you always starting from the same place, in case inside the inspect you select another document.
So using this idea, this should do the trick.
QUESTION
I have a tampermonkey script with this header:
...ANSWER
Answered 2021-May-14 at 01:52Because the page contains an iframe, and that iframe links to news.google.com:
Userscripts run in iframes, and when they do, they get added to the Tampermonkey icon at the top.
QUESTION
I'm trying to find the corresponding code for puppeteer to automate a button press.
In a userscript it can be done easily via
...ANSWER
Answered 2021-May-04 at 03:05The below code should work.
QUESTION
I did this tampermonkey script to parse my gmail inbox items and add a button linking to our Redmine Issue Tracker, so I can open the thread without having to open the email. This button I added, immediately open a new tab and switch focus to it.
It works fine, except that every time I click the button, it also opens the email on the Gmail page/browser tab. To fix this, I added a setTimeout(function() { window.history.go(-1); }, 1000)
to jump back after opening the link.
The problem is that this does not allow me to open several issues at once, i.e., by holding the Ctrl+Click
because it opens the email and jumps back (big flickering).
How could I stop the email from opening when I click on the button I added?
I tried setting the timeout to 0, i.e., setTimeout(function() { window.history.go(-1); }, 0)
, but this does not helps because GMail opens the email both, in the current browser tab/page and in a new page (along with my Redmine page), then I have 2 new pages opened when I click my button with Ctrl+Click
.
- Is there something I could add to
setTimeout(..., 0)
which could cancel the email opening before it starts? (So I can open several tabs at once by Holding theCtrl
button) - Or is there a way to remove the click event from opening the email when I click on the button I just added? (So I can open several tabs at once by Holding the
Ctrl
button)
ANSWER
Answered 2021-May-08 at 18:33Simply preventing the event from propagating up to Gmail's click listener on the row does the trick:
QUESTION
For the life of me I cannot get this to work.
I'm trying to write a userscript with tampermonkey that is @require'ing two jQuery resources - jQuery and jQuery UI.
Every single time, chrome's console gives me two to four errors, and they all looks like this:
core-c30de8a3f5468380db0b.js:1 GET about:blank net::ERR_UNKNOWN_URL_SCHEME
When I remove the two @requires, those errors go away. I've tried it with and without the window.jQ, http and https, pulling from jQuery directly and the Google ajax version, I've tried running at document start and document idle, I've tried about everything. All the rest of the script works, but requiring doesn't and obviously the jQuery bit doesn't.
Here is everything I have so far:
...ANSWER
Answered 2021-May-07 at 08:40Tested, working perfectly. the require works alright maybe some other EXT or something is blocking ?
anyhow, fixed it a bit so the drag work as well.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install userscript
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page