Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

GM_registerMenuCommand within command function kills whole menu #187

Open
vanowm opened this Issue Oct 27, 2013 · 0 comments

Comments

Projects
None yet
1 participant

vanowm commented Oct 27, 2013

Attempt register a new command within a function of previous command kills whole scriptish menu with no errors in the console:

function testFunc()
{
    GM_unregisterMenuCommand(UUID);
    UUID = GM_registerMenuCommand("new test " + (new Date()).getSeconds(), testFunc);
}
var UUID = GM_registerMenuCommand("test", testFunc);

Once menu was "killed" the only way to restore it is right click on scriptish icon.

This can be avoided by using setTimeout:

function testFunc()
{
    GM_unregisterMenuCommand(UUID);
    setTimeout(function() UUID = GM_registerMenuCommand("new test " + (new Date()).getSeconds(), testFunc), 0);
}
var UUID = GM_registerMenuCommand("test", testFunc);

Firefox v24
Scriptish v0.1.11

Scriptish icon is at the add-on bar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment