Userscript | Userscripts collection | Download Utils library
kandi X-RAY | Userscript Summary
kandi X-RAY | Userscript Summary
Here are the scripts that I usually use. If you have the same needs like me, feel free to use them. MIT license for all.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- install social lock
- Fetches content for content
- Download a vip instance .
- Displays a set of notes
- callback after loading
- download image files
- This function is called when KISS is decoder .
- Download the user s chat
- init page
- Get image type
Userscript Key Features
Userscript Examples and Code Snippets
Community Discussions
Trending Discussions on Userscript
QUESTION
I'm trying to write a very simple auto-refreshing userscript that immediately stops refreshing when the page is clicked anywhere. I have absolutely no coding experience so help would be greatly appreciated.
...ANSWER
Answered 2022-Mar-26 at 05:57(function() {
'use strict';
var didClick = false;
var interval = Math.floor(Math.random() * 4000);
function refresh() {
var timeout = setTimeout(function() {
if (didClick) {
return;
}
location.reload();
}, interval);
document.addEventListener('click', function clickHandler() {
if (!didClick) {
didClick = true;
clearTimeout(timeout);
}
document.removeEventListener('click', clickHandler);
});
}
window.onload = function() {
refresh();
};
})();
QUESTION
I am writing a userscript and unfortunately the website uses Angular JS which I don't know.
There is code:
...ANSWER
Answered 2022-Mar-16 at 17:20If someone will look for the same thing, I solved it this way:
QUESTION
I want to write a user script for Todoist, but - even though the URL matches - the script is not running on the Todoist but on every other webpage.
Even the simplest example won't run.
...ANSWER
Answered 2022-Feb-24 at 11:05Switched to the Plugin Violentmonkey" and it worked. I still don't know what the issue is. But it is solved for me.
QUESTION
This question is based on an issue I had before but never managed to resolve.
I'm running an userscript via FireMonkey which regulary sends requests to my backend server, those using CORS since they are cross-domain. For testing purposes my response headers are currently set very loosely backend-side:
...ANSWER
Answered 2022-Feb-15 at 00:42After some more research I finally found out that this is actually a firefox-related issue with userscripts: https://bugzilla.mozilla.org/show_bug.cgi?id=1715249
QUESTION
i don't really understand async. i have a function like this:
...ANSWER
Answered 2022-Feb-09 at 15:54function getTeam() {
let sir = new Promise((res, rej) => {
const teamsGrid = $('[class*="teamsgrid"]').find("p");
const firstTeam = $(teamsGrid[0]).text();
if (firstTeam != '') {
clearInterval(sir);
res(firstTeam.trim());
}
});
return sir();
}
QUESTION
I am trying to do a userscript rid of annoying notifications counter on title of pages like Facebook, Linkedin, etc.
Firstly I tried to use the extension "Rename Tab Title" https://chrome.google.com/webstore/detail/rename-tab-title/kppndhfiaenbiioipolacicknfmdcdep with my configuration described in the Support tab of that page, in the comment of user Sérgio Loureiro. But had no success.
What I mean is the "(1) " thing before the page title, that will be rendered on the respective tab. In this case I was doing it for the Vivaldi browser, that supports user script from the base, without any extension. I think this is also available for other browsers via tampermonkey or greasemonkey.
An example:
So I wrote an *.user.js
file with the contents:
ANSWER
Answered 2022-Jan-29 at 22:14I think I have succeeded, following @double-beep's advice of watching not only for characterData
.
This is the script I have now. I also had to make a .match
check before the replace, because some sites were becoming unresponsive.
QUESTION
Code contains errors: Uncaught SyntaxError: Unexpected token 'if' at undefined:18:22
When uploading to greasyfork I've got that error. The javascript file is:
...ANSWER
Answered 2022-Jan-28 at 07:38Conditional (ternary) operator may help:mynew.innerHTML = (!(myhtml == null)) ? myhtml : 'A random ' + tobuild + '.';
QUESTION
I have a weird issue where if I play an animation on one of my 3 monitors, YouTube videos on any other monitor crashes. I did fix this by disabling hardware acceleration in chrome://flags, but a new update in Chrome recently made the issue come back, and I haven't found a way to fix it yet. Animations occur on places like Facebook ("Someone is typing a comment...") or basically any website with a animation-duration
CSS property on something (spinners are probably the most used form of animations I guess).
I can verify this simply by placing this CSS on any page:
...ANSWER
Answered 2022-Jan-18 at 21:59Allow me to answer my own question. Setting animation-duration
to 0s !important
seems to be working. However, I added animation-play-state: paused
for good measure as well.
I made an userscript, and found that it doesn't target the Shadow DOM, so I have to traverse through every element, check if it's a shadow root, and then add the CSS. Since elements can be added to a page dynamically, I decided to do this every second. So far I cannot see a performance difference, even on pages with a lot of elements.
Install TamperMonkey (Chrome) or GreaseMonkey (Firefox) to use this:
QUESTION
I'm using the technique described here (code, demo) for using video frames as WebGL textures, and the simple scene (just showing the image in 2D, rather than a 3D rotating cube) from here.
The goal is a Tampermonkey userscript (with WebGL shaders, i.e. video effects) for YouTube.
The canvas is filled grey due to gl.clearColor(0.5,0.5,0.5,1)
. But the next lines of code, which should draw the frame from the video, have no visible effect. What part might be wrong? There are no errors.
I tried to shorten the code before posting, but apparently even simple WebGL scenes require a lot of boilerplate code.
...ANSWER
Answered 2022-Jan-08 at 15:24Edit: As it has been pointed out, first two sections of this answer are completely wrong.
TLDR: This might not be feasible without a backend server first fetching the video data.
If you check the MDN tutorial you followed, the video object passed to texImage2D
is actually an MP4 video. However, in your script, the video object you have access to (document.getElementsByTagName("video")[0]
) is just a DOM object. You don't have the actual video data. And it is not easy to get access to that for YouTube. The YouTube player do not fetch the video data in one shot, rather the YouTube streaming server makes sure to stream chunks of the video. I am not absolutely sure on this, but I think it'll be very difficult to work around this if your goal is to have a real time video effects.
I found some discussion on this (link1, link2) which might help.
That being said, there are some issues in your code from WebGL perspective. Ideally the code you have should be showing a blue rectangle as that is the texture data you are creating, instead of the initial glClearColor
color. And after the video starts to play, it should switch to the video texture (which will show as black due to the issue I have explained above).
I think it is due to the way you had setup your position data and doing clip space calculation in the shader. That can be skipped to directly send normalized device coordinate position data. Here is the updated code, with some cleaning up to make it shorter, which behaves as expected:
QUESTION
I'm following the WebGL tutorial from MDN (code, demo (black rectangle)) to create a WebGL canvas.
The goal is a userscript (with WebGL shaders, i.e. video effects) for YouTube. So I opened a YouTube video page and put the code below (from the link above) into the JavaScript console. The canvas got created, but it is invisible.
The canvas inherits a lot of CSS from YouTube by default. Am I overlooking some CSS properties that make it invisible? What to look out for in such cases? It should be black.
...ANSWER
Answered 2022-Jan-04 at 02:19Your canvas is there, but it's not on-top. Set some additional CSS for positioning. For example:
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