开发者

chrome.contextMenus in hosted app's local page

开发者 https://www.devze.com 2023-03-04 04:58 出处:网络
I try to add context menu item to my hosted app. When i add code like this, context menu appears in all pages:

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

精彩评论

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