How to add a button to the browser panel with the help of JavaScript; when clicked, it will execute JavaScript code on any currently open site?
Need to create userscript ?
How through it to add such a button on the panel?

    1 answer 1

    You need to look in the direction of browser extensions.

    Standard client-side JavaScript does not allow adding buttons to the browser panel and generally somehow influencing the behavior of the browser itself, since it is executed in a protected environment, and browser developers cannot allow the pages of the site to influence the operation of the browser itself.

    But this functionality is made on the basis of browser extensions, though for each browser you will have to write your own extension.

    You can read about writing extensions for chrome here .

    In addition, you can look in the direction of JavaScript client scripts via Tampermonkey , this is an extension for different browsers that allows you to run custom scripts on sites, though not sure that you can put the script into a separate button, but I think you can hang it on a hotkey if the script is injected to each site . Or run through the interface of Tampermonkey itself.

    • Thank you very much - Artem
    • @Artyom if the answer suits you, please mark it with an answer. - Dmitry Polyanin