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

Side by Side Diff: chrome/browser/resources/gaia_auth/util.js

Issue 888173002: cros: Restrict gaiaURL to be http and https only. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix blank line Created 5 years, 10 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
« no previous file with comments | « chrome/browser/resources/gaia_auth/main.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 * Alias for document.getElementById. 6 * Alias for document.getElementById.
7 * @param {string} id The ID of the element to find. 7 * @param {string} id The ID of the element to find.
8 * @return {HTMLElement} The found element or null if not found. 8 * @return {HTMLElement} The found element or null if not found.
9 */ 9 */
10 function $(id) { 10 function $(id) {
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 /** 65 /**
66 * Extract domain name from an URL. 66 * Extract domain name from an URL.
67 * @param {string} url An URL string. 67 * @param {string} url An URL string.
68 * @return {string} The host name of the URL. 68 * @return {string} The host name of the URL.
69 */ 69 */
70 function extractDomain(url) { 70 function extractDomain(url) {
71 var a = document.createElement('a'); 71 var a = document.createElement('a');
72 a.href = url; 72 a.href = url;
73 return a.hostname; 73 return a.hostname;
74 } 74 }
75
76 /**
77 * Extract protocol from an URL.
78 * @param {string} url An URL string.
79 * @return {string} The protocol of the URL.
80 */
81 function extractProtocol(url) {
82 var a = document.createElement('a');
83 a.href = url;
84 return a.protocol;
85 }
86
OLDNEW
« no previous file with comments | « chrome/browser/resources/gaia_auth/main.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698