How to Add ContextMenu Item to Mturk Requester

56 Views Asked by At

I'm writing a Chrome Extension and I need to add an item the context menu when right clicking a requester on the Mturk HIT Groups window. I've read how to add context menus but nothing seems to apply to adding an additional context item to an existing menu or how to connect that menu to my addition. Can someone point me to some documentation on how to accomplish that? TIA.

After a little more research I came up with this code:

chrome.contextMenus.create({
        id: "autoselectid",
        title: "Auto Select",
        contexts: ["browser_action"],
        parentId: parentid
     });

This doesn't work as I get the error:

Unchecked runtime.lastError: Cannot find menu item with id 2037286881

Since I can't find that error in my context, I don't know where to go from here.

1

There are 1 best solutions below

7
syncmate On

I don't know anything about MTurk but to add an new item to an already existing context menu you have to use chrome.contextMenus.create passing a new id and optionally the parentId as parameters (if that new item is nested inside another)