Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: background.js

Issue 5203617959116800: Fixed regression: Context menu clickhide broken (Closed)
Patch Set: Created Nov. 28, 2013, 3:08 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/background.js » ('j') | chrome/background.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(info, tab)
{
if(info.srcUrl)
- chrome.tabs.sendRequest(tab.id, {reqtype: "clickhide-new-filter", filter: info.srcUrl});
- }});
+ tab.sendMessage({type: "clickhide-new-filter", filter: info.srcUrl});
+ });
}
});
}
« no previous file with comments | « no previous file | chrome/background.js » ('j') | chrome/background.js » ('J')

Powered by Google App Engine
This is Rietveld