violentmonkey | Violentmonkey provides userscripts support for browsers | Browser Plugin library

 by   violentmonkey JavaScript Version: v2.14.2 License: MIT

kandi X-RAY | violentmonkey Summary

kandi X-RAY | violentmonkey Summary

violentmonkey is a JavaScript library typically used in Plugin, Browser Plugin applications. violentmonkey has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

Violentmonkey provides userscripts support for browsers. It works on browsers with WebExtensions support.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              violentmonkey has a medium active ecosystem.
              It has 4135 star(s) with 374 fork(s). There are 96 watchers for this library.
              There were 1 major release(s) in the last 12 months.
              There are 36 open issues and 1035 have been closed. On average issues are closed in 82 days. There are 2 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of violentmonkey is v2.14.2

            kandi-Quality Quality

              violentmonkey has 0 bugs and 0 code smells.

            kandi-Security Security

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

            kandi-License License

              violentmonkey is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              violentmonkey releases are available to install and integrate.
              Installation instructions are not available. Examples and code snippets are available.
              It has 1062 lines of code, 0 functions and 146 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed violentmonkey and discovered the below as its top functions. This is intended to give you an instant insight into violentmonkey implemented functionality, and help decide if they suit your requirements.
            • Mongo API implementation .
            • collect data from storage
            • Makes a wrapper for global scope events .
            • wrap the xhr - response callback
            • Inject scripts into the page
            • Make an http request .
            • Inject a page sandbox sandbox
            • Extract keys from files .
            • Injects an item into a DOM .
            • Make a meta info object .
            Get all kandi verified functions for this library.

            violentmonkey Key Features

            No Key Features are available at this moment for violentmonkey.

            violentmonkey Examples and Code Snippets

            No Code Snippets are available at this moment for violentmonkey.

            Community Discussions

            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

            How does "instant inject" in tampermonkey work?
            Asked 2021-Nov-11 at 12:53

            In tampermonkey, advanced settings, you can find a setting called "Inject mode" at the "Expirimental" tab. Here, you can select a mode called "Instant".

            I was wondering, what does it do different? How does it work? Is it simular to ViolentMonkeys injection methods?

            ...

            ANSWER

            Answered 2021-Nov-11 at 12:53

            Judging by the source code in other extensions like Stylus or Violentmonkey (beta) that recently added the same feature:

            1. The background script makes a Blob in the background script with the data, gets its URL via URL.createObjectURL, puts it into a Set-Cookie header via chrome.webRequest API.
            2. The content script reads the URL from document.cookie and uses it in a synchronous XMLHttpRequest to get the original data synchronously.

            This trick is based on an answer by Xan.

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

            QUESTION

            Using Javascript, refresh a page every 30 seconds UNLESS a phrase appears
            Asked 2021-Aug-30 at 11:20
            Existing code

            I use the following code in ViolentMonkey (or GreaseKit or TamperMonkey) to refresh a page every 30 seconds:

            ...

            ANSWER

            Answered 2021-Aug-28 at 19:36

            You can read the .innerText property of the body, then use String#includes to see if your phrase is present.

            If it is present you can return out of the function to end the script.

            Something like this:

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

            QUESTION

            Why am I able to remove certain elements using document.getElementsByClassName() but not others?
            Asked 2021-Jan-26 at 22:48

            I'm trying to create a simple script in ViolentMonkey to run on Letterboxd.com film pages - e.g. https://letterboxd.com/film/mirror/.

            I'm aiming to remove certain elements from the page - namely, the average rating and the facebook share buttons.

            My script looks like so:

            ...

            ANSWER

            Answered 2021-Jan-26 at 22:32

            The problem here seems to be that the rating graph (incl. the average rating) is loaded asynchronous and thus is not present when your script runs.

            In order to counter this, you could listen for changes of the parent .sidebar element and then remove it as soon as it's present:

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

            QUESTION

            removing an element with a userscript
            Asked 2021-Jan-02 at 07:01

            First attempt at a userscript, and despite finding numerous examples on the internet of how to remove elements from a page, none of them work (and this looks like one of the most basic applications of a userscript, too).

            Using violentmonkey-2.12.8 on this page:

            https://www.zerohedge.com/economics/2020-greatest-hits-most-popular-articles-past-year-and-look-ahead

            I want to remove the "exitModalOverlay" div (disabling it in the developer tools does exactly what I want), which blacks out the page (preventing me from reading it).

            I will insert one of the more common techniques I have found (which doesn't work). I would appreciate any method which does. Thanks.

            ...

            ANSWER

            Answered 2021-Jan-02 at 01:25

            QUESTION

            How to block url or .js file execution on a specific using greasemonkey script? (client side)
            Asked 2020-Dec-26 at 06:33

            I want to stop a javascript .js to load on a specific website with greasemonkey/violentmonkey scrpit

            ...

            ANSWER

            Answered 2020-Dec-26 at 06:33

            The second method below usually works but something seems to be interfering with it on your page for some reason. An ugly workaround is to put an empty hljs property on the window in advance, so that the page script, when run, thinks it already exists and does nothing:

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

            QUESTION

            How to make a ViolentMokey userScript into a Browser Extension?
            Asked 2020-Aug-20 at 00:45

            I have been trying to migrate an userScript into my own extension but for some reason I am not able to run the following code:

            ...

            ANSWER

            Answered 2020-Aug-01 at 10:29

            To start with, remove the glob as it can cause issues.

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

            QUESTION

            greasemonkey throws SecurityError for a simple script
            Asked 2020-Mar-28 at 18:15

            I'm new to greasemonkey and trying to understand how greasemonkey is different from the embedded web console. A simple script which works perfectly on web console does not work on greasemonkey, and I have no idea why.

            Environments
            • Firefox 74.0 on Arch Linux

            • Greasemonkey 4.9

            Web Console

            Here is the test script I use:

            ...

            ANSWER

            Answered 2020-Mar-28 at 18:15

            Web Console is part of browser scope while a GreaseMonkey script is injected into a page content and its scope it limited to that page only.

            You can open a new tab/window from page content with GM but that window/tab will have its own page content scope which is separate from the first one. Therefore, you can not access properties belonging to another tab/window from a page content of different tab.

            This separation is for all content scripts and not only for GM. Otherwise, it would have created a great security risk if JS in one tab/page could access data on other tabs.

            Update:

            As pointed out by wOxxOm, the CSP and cross-origin policy prevents Cross-Origin Resource Sharing (CORS).

            In your example, in Firefox, the first issue is that Firefox will "Block pop-up windows" from the content script.

            Testing Firefox dedicated userScripts API on FireMonkey, after allowing popup, still causes an error:

            SecurityError: Permission denied to access property "onload" on cross-origin object

            In this case, I believe it is due to the sandboxing of userScripts for security.

            GM/TM/VM do not use the userScripts API and use other means to inject userSripts which results in different outcome.

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

            QUESTION

            Share greasemonkey script and database between Windows and Android Firefox
            Asked 2020-Mar-12 at 20:30

            I've been using a homemade greasemonkey scripts for ages on my laptop Firefox. It includes storing data with GM.setValue.

            Now I just bought an Android tablet, and would like to be able to use this script and update the values, whereas I'm using the laptop or the tablet.

            Hoped that Firefox Sync would handle that, but not even the scripts are synced.

            I thought of synchronizing the script dans db files (Google drive, dropbox, whatever), but I realized that since the v4, the db that used to be in gm_scripts is gone, and I have no idea where Greasemonkey stores either the scripts or their associated database now.

            I'm looking for anything that might make it work.

            1) Is there a way to handle that with Firefox Sync ?

            2) Would an alternative (Tampermonkey, Violentmonkey, ?) handle that better ?

            3) Where can I find the scripts/database in the new Greasemonkey system ?

            4) Could I synchronize them via Google drive ? (There seem to be some hacks to sync a file between machines)

            5) Would there be a simple, free alternative that would allow me to synchronize a very small file between machines ?

            =============================================== Update on this:

            I tried TamperMonkey instead, it has a sync feature but even if it seems ok on different laptops or my phone, the syncing is random at best on the tablet.

            Also realized that only scripts are synced, and not their data. The script almost never changes, but the data is updated several times a day, so not really a solution anyway.

            Data doesn't exist anymore in a readable file format, so no luck either on syncing the data file externally.

            TamperMonkey has also an import/export feature, this does take the data into account. So the best I can do for now is thinking about exporting then importing every time I switch device. Not ideal so still in search of a better solution.

            ...

            ANSWER

            Answered 2020-Feb-03 at 05:57

            storage.sync

            Represents the sync storage area. Items in sync storage are synced by the browser, and are available across all instances of that browser that the user is logged into (e.g. via Firefox sync, or a Google account), across different devices.

            There are limitations with sync.

            • Sync requires login
            • Up to 100kb can be synced and more than that fails
            • Storage sync usually syncs the entire extension storage and in case of user-script managers, they are often larger than 100kb as they include the user-scripts as well
            • Data is stored elsewhere (not on your computer) which can have security/privacy concerns
            • Storage read/write requires internet access and longer times due to remote data storage
            • Extension must have the sync option

            1) Is there a way to handle that with Firefox Sync ?

            Yes but depends on aforementioned. While Firefox sync doesn't appear to have the 100kb limit, syncing the entire Firefox takes longer (How do I set up Sync on my computer?).

            2) Would an alternative (Tampermonkey, Violentmonkey, ?) handle that better ?

            Greasemonkey: No sync feature
            Tampermonkey: Sync to Dropbox, Google Drive, or a WebDAV service
            Violentmonkey: Sync to Dropbox, OneDrive, Google Drive, or a WebDAV service
            Firemonkey: No sync feature

            TM/VM 3rd party storage sync allows storage of more than 100KB. However, using 3rd party storage allows 3rd party tracking which is a privacy consideration. The storage read/write operation is also a lot slower.

            3) Where can I find the scripts/database in the new Greasemonkey system ?

            Since Firefox 57, extensions can not save files to the HD and the only storage area is the extension storage which is not accessible as before.

            4) Could I synchronize them via Google drive ? (There seem to be some hacks to sync a file between machines)

            Refer to above

            5) Would there be a simple, free alternative that would allow me to synchronize a very small file between machines ?

            That depends on the set-up and how often data is changed.

            For example, if data is not often changed, especially if the data privacy is imperative, there is the backup export/import option (script + data). Therefore, the extension data can be saved to a USB flash drive and loaded anywhere (suitable for shared environment).

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

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

            Vulnerabilities

            No vulnerabilities reported

            Install violentmonkey

            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/violentmonkey/violentmonkey.git

          • CLI

            gh repo clone violentmonkey/violentmonkey

          • sshUrl

            git@github.com:violentmonkey/violentmonkey.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

            Explore Related Topics

            Consider Popular Browser Plugin Libraries

            Try Top Libraries by violentmonkey

            generator-userscript

            by violentmonkeyJavaScript

            violentmonkey-mx

            by violentmonkeyJavaScript

            violentmonkey-oex

            by violentmonkeyJavaScript

            violentmonkey.github.io

            by violentmonkeyJavaScript

            vm-shortcut

            by violentmonkeyTypeScript