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 Dec. 9, 2013, 4:29 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') | no next file with comments »
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(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});
+ });
}
});
}
« no previous file with comments | « no previous file | chrome/background.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld