Skip to content

GM_unregisterMenuCommand will cause all the script menus to disappear. v4.18.0 #1607

@F9y4ng

Description

@F9y4ng

(Please fill out the issue template with your details)

Expected Behavior

fixed menu issues.

Actual Behavior

GM_unregisterMenuCommand will cause all the script menus to disappear, even the menus of other scripts.

when use GM_unregisterMenuCommand:

menu error

Specifications

  • Chromium: (i.e. 64.0.3282.140) chrome 106.0.5249.91 / Firefox 105.0.1
  • TM: (i.e. 4.5.5648) 4.18.0
  • OS: (i.e. MacOS 10.13.4) WIN 10

Script

(Please give an example of the script if applicable.)

// ==UserScript==
// @name         Test
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        *://*/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=google.com
// @grant              GM_registerMenuCommand
// @grant              GM_unregisterMenuCommand
// ==/UserScript==

(function() {
    'use strict';
    let test1 = GM_registerMenuCommand("test1", () => {
               alert("test1");
    });
    let test2 = GM_registerMenuCommand("test2", () => {
               alert("test2");
    });
   GM_unregisterMenuCommand(test1);
})();

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions