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

Unified Diff: chrome/browser/resources/shared/js/util.js

Issue 6269015: Add facility to fix about: and file: links from chrome:// pages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: git add Created 9 years, 11 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
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 baa88afd1fa73b4b8a1ec9e6220041c2b2e080d5..230a2413e418724e876bcc46e034bdc5e0b88501 100644
--- a/chrome/browser/resources/shared/js/util.js
+++ b/chrome/browser/resources/shared/js/util.js
@@ -70,4 +70,25 @@ function parseQueryParams(location) {
params[pair[0]] = pair[1];
}
return params;
- }
+}
+
+function handleFileOrAboutLinkClicks(link) {
arv (Not doing code reviews) 2011/01/21 23:07:32 Please use a global handler instead. function han
+ // Handle left clicks.
+ link.onclick = function(event) {
+ if (link.href.search('file:') == 0 ||
+ link.href.search('about:') == 0) {
+ chrome.send('navigateToUrl', [link.href, '0']);
+ return false;
+ }
+ };
+
+ // Handle middle clicks.
+ link.onmouseup = function(event) {
+ if (event.button == 1 &&
+ (link.href.search('file:') == 0 ||
+ link.href.search('about:') == 0)) {
+ chrome.send('navigateToUrl', [link.href, '1']);
+ return false;
+ }
+ };
+}

Powered by Google App Engine
This is Rietveld 408576698