userscripts
userscripts copied to clipboard
New context menu architecture design
The current @run-at content-menu is an undocumented design.
It is currently registered with all contexts and only uses a limited browser.menus.ACTION_MENU_TOP_LEVEL_LIMIT. It leads to lack of scalability, and less suitable use cases.
The top level menu should be reserved more for the functionality of the extension itself. Most registry items generated by user script should use the secondary menu.
Also, we should register different usage scenarios to different contexts, not to all contexts. Registration timing and persistence should also be considerations.
Note that the context menu should not be used as a direct replacement for GM.registerMenuCommand, it should be reimplemented in popup. Ref:#230