Permalink
Browse files

Restore legacy behavior when GM_rmc's commandFunc is not a function.

Fixes #1346
  • Loading branch information...
1 parent d58e50c commit df660ccf3ec95c1add336dfb4f3dfaf55c616d19 @arantius arantius committed Apr 27, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 content/menucommander.js
View
@@ -3,7 +3,9 @@ var GM_MenuCommander = {};
GM_MenuCommander.createMenuItem = function(command) {
var menuItem = document.createElement("menuitem");
menuItem.setAttribute("label", command.name);
- menuItem.addEventListener("command", command.commandFunc, true);
+ if ('function' == typeof commandFunc) {
+ menuItem.addEventListener("command", command.commandFunc, true);
+ }
if (command.accessKey) {
menuItem.setAttribute("accesskey", command.accessKey);

0 comments on commit df660cc

Please sign in to comment.