| Index: background.js |
| =================================================================== |
| --- a/background.js |
| +++ b/background.js |
| @@ -140,12 +140,10 @@ |
| else |
| tab.pageAction.show(); |
| - if (require("info").platform == "chromium") // TODO: Implement context menus for Safari |
| - // Set context menu status according to whether current tab has whitelisted domain |
| - if (excluded) |
| - chrome.contextMenus.removeAll(); |
| - else |
| - showContextMenu(); |
| + if (excluded) |
| + ext.contextMenus.removeAll(); |
| + else |
| + showContextMenu(); |
| } |
| /** |
| @@ -262,15 +260,15 @@ |
| // Set up context menu for user selection of elements to block |
| function showContextMenu() |
| { |
| - chrome.contextMenus.removeAll(function() |
| + ext.contextMenus.removeAll(function() |
| { |
| if(typeof localStorage["shouldShowBlockElementMenu"] == "string" && localStorage["shouldShowBlockElementMenu"] == "true") |
| { |
| - chrome.contextMenus.create({"title": chrome.i18n.getMessage("block_element"), "contexts": ["image", "video", "audio"], "onclick": function(info, tab) |
| + ext.contextMenus.create(ext.i18n.getMessage("block_element"), ["image", "video", "audio"], function(srcUrl, tab) |
| { |
| - if(info.srcUrl) |
| - chrome.tabs.sendRequest(tab.id, {reqtype: "clickhide-new-filter", filter: info.srcUrl}); |
| - }}); |
| + if (srcUrl) |
| + tab.sendMessage({type: "clickhide-new-filter", filter: srcUrl}); |
| + }); |
| } |
| }); |
| } |