tampermonkey | popular userscript manager , with over 10 million users | Browser Plugin library

 by   Tampermonkey JavaScript Version: Current License: GPL-3.0

kandi X-RAY | tampermonkey Summary

kandi X-RAY | tampermonkey Summary

tampermonkey is a JavaScript library typically used in Plugin, Browser Plugin applications. tampermonkey has no vulnerabilities, it has a Strong Copyleft License and it has medium support. However tampermonkey has 21 bugs. You can download it from GitHub.

Tampermonkey is the most popular userscript manager for Google Chrome.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              tampermonkey has a medium active ecosystem.
              It has 3322 star(s) with 386 fork(s). There are 116 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 172 open issues and 1527 have been closed. On average issues are closed in 154 days. There are 6 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of tampermonkey is current.

            kandi-Quality Quality

              tampermonkey has 21 bugs (0 blocker, 0 critical, 18 major, 3 minor) and 3 code smells.

            kandi-Security Security

              tampermonkey has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              tampermonkey code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              tampermonkey is licensed under the GPL-3.0 License. This license is Strong Copyleft.
              Strong Copyleft licenses enforce sharing, and you can use them when creating open source projects.

            kandi-Reuse Reuse

              tampermonkey releases are not available. You will need to build from source code and install.
              tampermonkey saves you 437 person hours of effort in developing the same functionality from scratch.
              It has 1034 lines of code, 0 functions and 46 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed tampermonkey and discovered the below as its top functions. This is intended to give you an instant insight into tampermonkey implemented functionality, and help decide if they suit your requirements.
            • Creates CodeMirror instance .
            • Processes regular expression
            • parse html tag
            • tag handler
            • Change DOM attributes
            • The handler for the mouseup event .
            • Parse a string .
            • Fixes IE event listeners .
            • Process CSS selector token .
            • Advances of the first token
            Get all kandi verified functions for this library.

            tampermonkey Key Features

            No Key Features are available at this moment for tampermonkey.

            tampermonkey Examples and Code Snippets

            No Code Snippets are available at this moment for tampermonkey.

            Community Discussions

            QUESTION

            jQuery to change background on table row based on values of two cells within that row
            Asked 2022-Mar-09 at 03:41

            I have a tampermonkey script that highlights table rows when specific columns contain specific text.

            For example the code below successfully highlights rows were column 1 contains 'M' and rows where column 3 contains 'P'.

            ...

            ANSWER

            Answered 2022-Mar-09 at 03:27

            Grab all the elements and filter that down to the ones with the elements matching your requirements.

            Once you have that filtered collection, set the background colour.

            Source https://stackoverflow.com/questions/71403079

            QUESTION

            Issues creating a global variable list in javascript (Tampermonkey)
            Asked 2022-Jan-28 at 09:31

            I'd like to create a global variable list in javascript that will add new elements to the list. I need it global because I'm using Tampermonkey, and I want to keep old elements inside the list and able to add new elements to it.

            How can I do this correctly?

            I have tried something like this but it's not working :c

            ...

            ANSWER

            Answered 2022-Jan-28 at 09:31
            GM_setValue("arr_names", check_empty.push(user));
            

            Source https://stackoverflow.com/questions/70891124

            QUESTION

            how to add an element in the outer body tag and exclude iframe body tags
            Asked 2022-Jan-28 at 09:09

            I try to add an button via Tampermonkey to websites. That button should only appear in the outer body and not in iframes.

            So, for example, this is before the Tampermokey runs...

            ...

            ANSWER

            Answered 2022-Jan-28 at 09:09

            Update 2

            If the pages are dynamically generated, varies in content, and/or what and how things are loaded cannot be controlled, etc., try adding the button with .insertAdjacentHTML() method. Also adding elements to body isn't the best choice of locations because it's at the top of the hierarchy of HTML and there should be only few elements there.

            Source https://stackoverflow.com/questions/70884285

            QUESTION

            selecting dynamic class names generated by react from a user script?
            Asked 2022-Jan-09 at 21:56

            I tend to write my own user scripts (aka Violentmonkey / Tampermonkey scripts; formerly Greasemonkey scripts). I often end up selecting elements by class name while doing so - either using native javascript or having the script load jQuery and using that.

            I've noticed that sometimes I see dynamically generated class names like "SeriesIndexFooter-footer-3WmRg" with the bolded bits appearing to be some randomly generated part (I think this gets generated by React? I haven't used React myself but have sometimes seen "React" in other element names when encountering these). Obviously, I can just hard-code these classnames in my script AS-IS and it will work... but my concern is that if a site / local server app gets updated later that this will break my user script.

            e.g.

            ...

            ANSWER

            Answered 2022-Jan-09 at 21:56

            There is no way you can predict class suffix that you are talking about.

            That is used for purpose of encapsulating styles so that it applies only for that specific element or group of elements.

            What you can do in your case is to use few CSS selectors that relay on searching values in attributes. In your case it would look something like this:

            Source https://stackoverflow.com/questions/70645666

            QUESTION

            WebGL textures from YouTube video frames
            Asked 2022-Jan-08 at 15:24

            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:24

            Edit: 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:

            Source https://stackoverflow.com/questions/70627240

            QUESTION

            Shaders for YouTube videos using Three.js in a userscript
            Asked 2021-Dec-31 at 18:03

            I'd like to apply a shader to videos on YouTube.

            My current attempt is to use Three.js for that, namely to turn this example of applying a shader to a video (code here) into a Tampermonkey userscript to run on youtube.com.

            Are the following @require statements correctly translated from the original import statements? How do I solve the problems eslint: no-undef - 'THREE' is not defined, eslint: no-undef - 'PerspectiveCamera' is not defined (if I delete THREE., assuming that the contents of three.module.js get imported directly), eslint: no-undef - 'RenderPass' is not defined?

            ...

            ANSWER

            Answered 2021-Dec-31 at 18:02

            eslint: no-undef - 'THREE' is not defined is not necessarily problematic.

            Use normal JavaScript versions of the Three.js scripts instead of module versions:

            Source https://stackoverflow.com/questions/70543060

            QUESTION

            Uncaught TypeError: Failed to construct 'MouseEvent': Failed to read the 'view' property from 'UIEventInit': Failed to convert value to 'Window'
            Asked 2021-Nov-15 at 15:45

            I can run the following in the Chrome console and it does what I want without error:

            document.querySelector('.flat.pagination.next').dispatchEvent(new MouseEvent("mousedown",{ view: window, bubbles: true, cancelable: true, clientX: 0, clientY: 0, button: 0 }));

            However, if I put the same line of code in to a Tampermonkey script, I get the following error:

            Uncaught TypeError: Failed to construct 'MouseEvent': Failed to read the 'view' property from 'UIEventInit': Failed to convert value to 'Window'.

            Presumably there is something wrong with the view: window part, but I can't see why it would behave differently in the console to a script.

            Any ideas how I can get it to work?

            ...

            ANSWER

            Answered 2021-Nov-15 at 15:45

            I was able to get it to work as I needed by removing the options:

            Source https://stackoverflow.com/questions/69976214

            QUESTION

            Tampermonkey script blocked by a CSP error
            Asked 2021-Oct-31 at 14:54

            I am new to javascript and Tampermonkey. I wanted to add a frame to the Memrise's website. The code is as follows:

            ...

            ANSWER

            Answered 2021-Oct-31 at 14:54

            Use GM_addElement to circumvent such CSP restrictions:

            Source https://stackoverflow.com/questions/69786354

            QUESTION

            Disabling YouTube's drag down for miniplayer functionality
            Asked 2021-Oct-31 at 07:21

            If I watch a YouTube video and try to drag the player down, it's doing this:

            Sometimes it doesn't do this. Sometimes it's only doing this in fullscreen. Sometimes it's also doing this in theatre mode. It started happening not so long ago.

            I've tried document.addEventListener('mousemove', (e) => { e.stopImmediatePropagation(); e.stopPropagation(); e.preventDefault();}, true) in Tampermonkey, but it disables all the other mousemoves except the drag down for miniplayer. I've tried user-select: none, but it doesn't solve this issue either.

            I've tried in Incognito mode, with extensions disabled. Nothing helped.

            I'm running latest Chrome. 95.0.4638.54

            This doesn't happen in Chromium for some reason: version 94.0.4606.81

            I'm not the only one with this problem: https://www.reddit.com/r/youtube/comments/l4falt/is_there_a_way_to_turn_off_the_drag_down_to/

            I haven't found any other forum posts about it.

            Is there any way to disable this functionality?

            Update: this code seems to work: https://pastebin.com/n093g9Ur

            ...

            ANSWER

            Answered 2021-Oct-31 at 07:21

            It was a bit difficult, but to solve this problem:

            1. First it was necessary to find the element which listens to user events which trigger this behaviour, by using Ctrl-Shift-C on YouTube player's element and then adding "pointer-events: 'none'" to its parent elements' CSS, until it disables this functionality.
            2. The element that was listening for the events can be selected with document.querySelector('ytd-page-manager #player-container'); (it turns out there are multiple elements with player-container id on YouTube).
            3. Then we get event listeners for this element by typing "getEventListeners(temp1)" in Chrome developer console (where temp1 is the 'ytd-page-manager #player-container' element after right clicking and choosing "store as a global variable")
            4. Then we add our own event listener with Capture:true and stop immediate propagation for these events (it was enough to do for the "pointerdown" event)

            So after the page has loaded the code would be

            Source https://stackoverflow.com/questions/69768748

            QUESTION

            How to view a raw build artifact without trigerring a download?
            Asked 2021-Oct-29 at 06:00

            On GitLab, you can browse and download job artifacts at annoyingly redirected URLs like these:

            I can use these URLs as a download link in the release page. However, I'm distributing a userscript; users do not want to download them, they want to view them (so TamperMonkey and Greasemonkey can install them).

            How do I make it so users can install a userscript from an arbitrary branch/tag/commit without quitting GitLab?

            ...

            ANSWER

            Answered 2021-Oct-29 at 06:00

            Unfortunately this is not supported for gitlab.com since workhorse always sets the content disposition as 'attachment' for artifacts, causing the browser to download the file. The only cases where the content disposition header is set as 'inline' is when viewing blobs.

            Your best possible workaround would be to commit your built files to the repository (or another repository/snippets) and use the raw view. Conveniently, project snippets are basically a repository within a repository you can use for this purpose.

            For example, you can use the project snippets API in your pipeline to create a snippet containing your user scripts, then use the snippet raw URL in your release. I tested this as working with tampermonkey.

            Another possible workaround may be to host your files on GitLab pages, but each publish to GitLab pages will overwrite the previous publish, so you'll have to download all your previous artifacts and re-publish them every time if you want to support all your branches/tags.
            This may also prove problematic, as concurrent pipelines (like a tag+branch pipeline) may have race-conditions unless you guard them with resource groups.

            Source https://stackoverflow.com/questions/69762831

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install tampermonkey

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/Tampermonkey/tampermonkey.git

          • CLI

            gh repo clone Tampermonkey/tampermonkey

          • sshUrl

            git@github.com:Tampermonkey/tampermonkey.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link