Is there any way to run a custom js script in a browser? I check some values on a site and fix them. Usually, I do it manually but I wrote js script which allows me to do it in an automatic way partially. I am looking for a way to run this script via hotkeys or using browser extension instead of ctrl+v in a browser console.
Asked
Active
Viewed 828 times
1
-
Google gave me this: https://gist.github.com/danharper/8364399 – Martijn Jan 14 '20 at 10:50
-
The answer is in the tags you've used :) A chrome extension can manipulate the contents of a page and it can also be triggered by a shortcut key. – Lix Jan 14 '20 at 10:51
-
Is this https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo?hl=en what you looking for? – Lellansin Jan 14 '20 at 10:52
-
Without add-on you can already save some snippets in the "Sources" tab of the dev console in Chrome (F2 - "Sources" - "New Snippet" - ...etc). – trincot Jan 14 '20 at 10:53
-
There are also [userscripts](https://greasyfork.org/en). They are the smaller versions of browser extensions but are more cross-compatible. Also, usually a lot less sophisticated because they are faster to develop. You could also save the script as a [Bookmarklet](https://en.wikipedia.org/wiki/Bookmarklet). It's a bookmark that runs a script when used, instead of redirecting you. – VLAZ Jan 14 '20 at 10:54
-
Thanks to you all. I think Tampermonkey is what I was looking for. – yummy Jan 14 '20 at 12:49
1 Answers
0
You could use a bookmarklet, but you would need to click instead of pressing a key.

Unresolved
- 17
- 6
-
Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Aug 31 '22 at 12:17