CoreLibs icon indicating copy to clipboard operation
CoreLibs copied to clipboard

Support `GM_registerMenuCommand` and `GM_unregisterMenuCommand`

Open piquark6046 opened this issue 3 years ago • 5 comments

Description

Currently, AdGuard does not support GM_registerMenuCommand and GM_unregisterMenuCommand that is required when an userscript developer wants to add its configuration feature, etc.

Suggestion

  • Option button I think that placing the button here is better.

    Screenshot

    Screenshot from 2022-11-25 13-37-30

  • The onClick event must be executed only when any matched webpage is opened.

Reference

  • https://violentmonkey.github.io/api/gm/#gm_registermenucommand

piquark6046 avatar Nov 25 '22 13:11 piquark6046

I don't think we should give userscript developers an ability to execute code inside our applications. The applications don't even have a javascript engine to run it, anyway. @ameshkov discuss? AFAIK userscripts that want to have persistent configuration usually implement some sort of a menu on the page that they are injected into, and store/load the values with GM_setValue/GM_getValue.

ngorskikh avatar Jan 09 '23 11:01 ngorskikh

Agreed. but I think we can implement this entirely in the page context without involving CoreLibs.

ameshkov avatar Jan 09 '23 11:01 ameshkov

As far as I understand, it’s still hanging in todo?

bropines avatar Jun 19 '24 13:06 bropines