GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Reconsider GM.registerMenuCommand (polyfill depends on API that's going away) · Issue #3078 · greasemonkey/greasemonkey

Reconsider GM.registerMenuCommand (polyfill depends on API that's going away) #3078

New issue
Copy link
New issue
Copy link
Closed
#2770
Closed
Reconsider GM.registerMenuCommand (polyfill depends on API that's going away)#3078
#2770
Copy link
Milestone
4.11

Description

@ssokolow
ssokolow
opened on Apr 29, 2020
Issue body actions

Because no other browser engine has bothered to support it, Firefox has, for a while now, had an open bug for removing the context menu amending capability that the registerMenuCommand part of the polyfill relies on.

There appears to be someone now interested in getting it "fixed" (ie. removing the support) so it'd probably be a good idea to reconsider GM4 not providing its own support for this.

I make heavy enough use of it for things like launching my configuration UIs that, if no suitable replacement is provided, I'll just have to drop support for GreaseMonkey and instruct users that, for technical reasons, I can only support ViolentMoney and TamperMonkey because I don't consider it acceptable UX to clutter up the site with such "set it once and almost never change it" configuration UI buttons.

Reacted by Stig Nygaard, Cerberus-tm, eight, SLC, Kagami Sascha Rosylight, chocolateboy and Qussayyon

Activity

  1. StigNygaard commented on Apr 29, 2020

    @StigNygaard
    StigNygaard
    on Apr 29, 2020
    More actions

    +1
    I like the HTML 5 Context Menus a lot, but if/when they disappear I too hope to have GM.registerMenuCommand back. I cannot see myself maintain another homemade solution for multi-site userscripts.

  2. arantius commented on Apr 29, 2020

    @arantius
    arantius
    on Apr 29, 2020
    Collaborator
    More actions

    Any suggestions for a UI/API that will still exist that you'd like to use?

    I guess we'll be forced to register things in the monkey menu?

  3. ssokolow commented on Apr 29, 2020

    @ssokolow
    ssokolow
    on Apr 29, 2020
    Author
    More actions

    That's the way TamperMonkey and ViolentMonkey do it.

    I suppose the other option would be to explore the feasibility of approximating what the polyfill does using browser.menus.create to shove all the userscript-registered menu items into a submenu of the context menu... though that'd be sub-optimal without some way to scope them to contexts since people generally expect the context menu to be contextual.

    (And, ideally, it'd still be good to have a way to put "configure this userscript" entries in the monkey menu rather than the context menu, similar to how Firefox's addon manager works.)

    That latter one really is an "explore the feasibility" though. It's been so long since I poked at the WebExtensions API that I can't remember its limitations in that respect. (I write userscripts because they're more portable and in protest of mandatory extension signing.)

    Reacted by Matthijs Wensveen
  4. eight04 commented on Apr 30, 2020

    @eight04
    eight04
    on Apr 30, 2020
    More actions

    Here is an older thread:
    #2714

    Reacted by 100の人 (エスパー・イーシア)
  5. esperecyan commented on Oct 4, 2020

    @esperecyan
    esperecyan
    on Oct 4, 2020
    Contributor
    More actions

    @arantius

    I guess we'll be forced to register things in the monkey menu?

    Even if the context menu had not been obsoleted from the spec, using it in place of GM_registerMenuCommand has the following disadvantages:

    • It is always inserted into the browser’s context menu, which gets in the way of browsing
    • Because it inserts into an unsafe context (DOM of Web page side), could causes privacy and security issues
    • Unavailable if the context menu is blocked by the Web page side.
  6. ssokolow commented on Dec 9, 2020

    @ssokolow
    ssokolow
    on Dec 9, 2020
    Author
    More actions

    Firefox trunk just landed a patch to disable access to <menuitem> with a target release milestone of Firefox 85.

    https://bugzilla.mozilla.org/show_bug.cgi?id=1680596#c11

    (Specifically, it puts it behind a dom.menuitem.enabled pref which defaults to false.)

    Reacted by 100の人 (エスパー・イーシア)
  7. esperecyan commented on Dec 9, 2020

    @esperecyan
    esperecyan
    on Dec 9, 2020
    Contributor
    More actions

    @arantius The implementation of GM.registerMenuCommand() became an urgent issue.

    This API has been implemented in both Violemntmonkey and Tampermonkey, as well as in Greasemonkey 3.x. It is not replaceable in any other way, as mentioned above, and is important for compatibility.

    I have address all previous concerns about the implementation in #2770 update. Why cannot that be merged?

  8. esperecyan commented on Jan 10, 2021

    @esperecyan
    esperecyan
    on Jan 10, 2021
    Contributor
    More actions

    I rebased #2770 onto the latest master.
    It is possible to release Greasemonkey that implements GM.registerMenuCommand().

    Reacted by Patrick Westerhoff, Stig Nygaard and chocolateboy
  9. esperecyan
    added a commit that references this issue on Jan 11, 2021

    Add `GM.registerMenuCommand()`.

    8017275
  10. arantius
    added this to the 4.11 milestone on Jan 18, 2021
  11. Cerberus-tm commented on Jan 18, 2021

    @Cerberus-tm
    Cerberus-tm
    on Jan 18, 2021
    Contributor
    More actions

    Great! I'll postpone updating Firefox until this has been released (no hurry, I often don't update immediately anyway).

  12. arantius
    closed this as completedin #2770on Jan 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      • 4.11

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.