开发者

chrome.contextMenus in hosted app's local page

I try to add context menu item to my hosted app. When i add code like this, context menu appears in all pages:

chrome.con开发者_JS百科textMenus.create({
    'title' : 'reload image',
    'contexts' : ['image'],
    'onclick' : function(info, tab) {

    }, 'documentUrlPatterns' : ['<all_urls>']
});

But this item is not displayed in my app. When i change documentUrlPattern to:

['chrome-extension://extensionId/*']

Nothing happens. How can i add context menu item to my hosted app's local page?


You cannot inject context menu in any extension page. That is unfortunately limitation. The engineers state it is a security limitation. A search in crbug.com can give you some ideas why.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜