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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * The global object. 6 * The global object.
7 * @param {!Object} 7 * @param {!Object}
8 */ 8 */
9 const global = this; 9 const global = this;
10 10
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 */ 63 */
64 function parseQueryParams(location) { 64 function parseQueryParams(location) {
65 var params = {}; 65 var params = {};
66 var query = unescape(location.search.substring(1)); 66 var query = unescape(location.search.substring(1));
67 var vars = query.split("&"); 67 var vars = query.split("&");
68 for (var i=0; i < vars.length; i++) { 68 for (var i=0; i < vars.length; i++) {
69 var pair = vars[i].split("="); 69 var pair = vars[i].split("=");
70 params[pair[0]] = pair[1]; 70 params[pair[0]] = pair[1];
71 } 71 }
72 return params; 72 return params;
73 } 73 }
74
75 function handleFileOrAboutLinkClicks(link) {
arv (Not doing code reviews) 2011/01/21 23:07:32 Please use a global handler instead. function han
76 // Handle left clicks.
77 link.onclick = function(event) {
78 if (link.href.search('file:') == 0 ||
79 link.href.search('about:') == 0) {
80 chrome.send('navigateToUrl', [link.href, '0']);
81 return false;
82 }
83 };
84
85 // Handle middle clicks.
86 link.onmouseup = function(event) {
87 if (event.button == 1 &&
88 (link.href.search('file:') == 0 ||
89 link.href.search('about:') == 0)) {
90 chrome.send('navigateToUrl', [link.href, '1']);
91 return false;
92 }
93 };
94 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698