Index: chrome/browser/resources/shared/js/util.js |
diff --git a/chrome/browser/resources/shared/js/util.js b/chrome/browser/resources/shared/js/util.js |
index 63b3a8c3e36d2420c9c4ec5088dd5e5079d7f18a..ff75b0c527617a3e6bda845e60142d3b49dbb2a7 100644 |
--- a/chrome/browser/resources/shared/js/util.js |
+++ b/chrome/browser/resources/shared/js/util.js |
@@ -108,12 +108,9 @@ function swapDomNodes(a, b) { |
aParent.insertBefore(b, afterA); |
} |
-/* |
- * Handles a click or mouseup on a link. If the link points to a chrome: or |
- * file: url, then call into the browser to do the navigation. |
- * @return {Object} e The click or mouseup event. |
- */ |
-function handleLinkClickOrMouseUp(e) { |
+// Handle click on a link. If the link points to a chrome: or file: url, then |
+// call into the browser to do the navigation. |
+document.addEventListener('click', function(e) { |
// Allow preventDefault to work. |
if (!e.returnValue) |
return; |
@@ -126,14 +123,10 @@ function handleLinkClickOrMouseUp(e) { |
} |
if ((el.protocol == 'file:' || el.protocol == 'about:') && |
- ((e.button == 0 && e.type == 'click') || |
- (e.button == 1 && e.type == 'mouseup'))) { |
+ (e.button == 0 || e.button == 1)) { |
chrome.send('navigateToUrl', |
[el.href, e.button, e.altKey, e.ctrlKey, e.metaKey, e.shiftKey]); |
e.preventDefault(); |
} |
} |
-} |
- |
-document.addEventListener('click', handleLinkClickOrMouseUp); |
-document.addEventListener('mouseup', handleLinkClickOrMouseUp); |
+}); |