I am porting a Chrome Extension to Firefox and there's a use case which requires generating a prompt to take input.
A context menu is created, on page context a prompt should open whose result is passed onto a function. In Chrome it works fine, but in Firefox it doesn't. The debugger stops & shows the stack trace and displays undefined:undefined. I'm trying to use window.prompt()
Please suggest an alternative or a method to work with this.
Console shows this, not sure if it's related:
NS_ERROR_NOT_AVAILABLE: Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIDOMWindowUtils.isParentWindowMainWidgetVisible]
chrome.contextMenus.create({
"title": "Title...",
"contexts":["page"],
"onclick": function(info, tab)
{
someFunc(window.prompt("someDisplayText", info.selectionText));
}
});
User contributions licensed under CC BY-SA 3.0