OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <include src="post_message_channel.js"> | 5 <include src="post_message_channel.js"> |
6 | 6 |
7 /** | 7 /** |
8 * @fileoverview Saml support for webview based auth. | 8 * @fileoverview Saml support for webview based auth. |
9 */ | 9 */ |
10 | 10 |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 * Invoked on the webview's loadcommit event for both main and sub frames. | 259 * Invoked on the webview's loadcommit event for both main and sub frames. |
260 * @private | 260 * @private |
261 */ | 261 */ |
262 onLoadCommit_: function(e) { | 262 onLoadCommit_: function(e) { |
263 // Skip this loadcommit if the top level load is just aborted. | 263 // Skip this loadcommit if the top level load is just aborted. |
264 if (e.isTopLevel && e.url === this.abortedTopLevelUrl_) { | 264 if (e.isTopLevel && e.url === this.abortedTopLevelUrl_) { |
265 this.abortedTopLevelUrl_ = null; | 265 this.abortedTopLevelUrl_ = null; |
266 return; | 266 return; |
267 } | 267 } |
268 | 268 |
| 269 // Skip for none http/https url. |
| 270 if (e.url.indexOf('https://') != 0 && |
| 271 e.url.indexOf('http://') != 0) { |
| 272 return; |
| 273 } |
| 274 |
269 this.isSamlPage_ = this.pendingIsSamlPage_; | 275 this.isSamlPage_ = this.pendingIsSamlPage_; |
270 this.injectJs_(); | 276 this.injectJs_(); |
271 }, | 277 }, |
272 | 278 |
273 /** | 279 /** |
274 * Handler for webRequest.onBeforeRequest, invoked when content served over | 280 * Handler for webRequest.onBeforeRequest, invoked when content served over |
275 * an unencrypted connection is detected. Determines whether the request | 281 * an unencrypted connection is detected. Determines whether the request |
276 * should be blocked and if so, signals that an error message needs to be | 282 * should be blocked and if so, signals that an error message needs to be |
277 * shown. | 283 * shown. |
278 * @param {Object} details | 284 * @param {Object} details |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 * @param {string} samlInjectedJs JS code to inejct for Saml. | 459 * @param {string} samlInjectedJs JS code to inejct for Saml. |
454 */ | 460 */ |
455 SamlHandler.setSamlInjectedJs = function(samlInjectedJs) { | 461 SamlHandler.setSamlInjectedJs = function(samlInjectedJs) { |
456 injectedJs = samlInjectedJs; | 462 injectedJs = samlInjectedJs; |
457 }; | 463 }; |
458 | 464 |
459 return { | 465 return { |
460 SamlHandler: SamlHandler | 466 SamlHandler: SamlHandler |
461 }; | 467 }; |
462 }); | 468 }); |
OLD | NEW |