Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(794)

Unified Diff: ui/file_manager/file_manager/background/js/background.js

Issue 1003303003: Files.app: Suppress error about removing a non-existent menu item. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Do not output the log. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/file_manager/background/js/background.js
diff --git a/ui/file_manager/file_manager/background/js/background.js b/ui/file_manager/file_manager/background/js/background.js
index 13531be2f7449a0a456f0904602384ef2a8ce244..b52deb6ed5b29cdf95fdf345d69d0197b84b0fd9 100644
--- a/ui/file_manager/file_manager/background/js/background.js
+++ b/ui/file_manager/file_manager/background/js/background.js
@@ -614,8 +614,12 @@ FileBrowserBackground.prototype.initContextMenu_ = function() {
// According to the spec [1], the callback is optional. But no callback
// causes an error for some reason, so we call it with null-callback to
// prevent the error. http://crbug.com/353877
+ // Also, we read the runtime.lastError here not to output the message on the
+ // console as an unchecked error.
// - [1] https://developer.chrome.com/extensions/contextMenus#method-remove
- chrome.contextMenus.remove('new-window', function() {});
+ chrome.contextMenus.remove('new-window', function() {
+ var ignore = chrome.runtime.lastError;
+ });
} catch (ignore) {
// There is no way to detect if the context menu is already added, therefore
// try to recreate it every time.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698