OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * | 10 * |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 lastPathComponentWithFragment: function() | 256 lastPathComponentWithFragment: function() |
257 { | 257 { |
258 return this.lastPathComponent + (this.fragment ? "#" + this.fragment : ""
); | 258 return this.lastPathComponent + (this.fragment ? "#" + this.fragment : ""
); |
259 }, | 259 }, |
260 | 260 |
261 /** | 261 /** |
262 * @return {string} | 262 * @return {string} |
263 */ | 263 */ |
264 domain: function() | 264 domain: function() |
265 { | 265 { |
| 266 if (this.isDataURL()) |
| 267 return "data:"; |
266 return this.host + (this.port ? ":" + this.port : ""); | 268 return this.host + (this.port ? ":" + this.port : ""); |
267 }, | 269 }, |
268 | 270 |
269 /** | 271 /** |
270 * @return {string} | 272 * @return {string} |
271 */ | 273 */ |
| 274 securityOrigin: function() |
| 275 { |
| 276 if (this.isDataURL()) |
| 277 return "data:"; |
| 278 return this.scheme + "://" + this.domain(); |
| 279 }, |
| 280 |
| 281 /** |
| 282 * @return {string} |
| 283 */ |
272 urlWithoutScheme: function() | 284 urlWithoutScheme: function() |
273 { | 285 { |
274 if (this.scheme && this.url.startsWith(this.scheme + "://")) | 286 if (this.scheme && this.url.startsWith(this.scheme + "://")) |
275 return this.url.substring(this.scheme.length + 3); | 287 return this.url.substring(this.scheme.length + 3); |
276 return this.url; | 288 return this.url; |
277 }, | 289 }, |
278 } | 290 } |
279 | 291 |
280 /** | 292 /** |
281 * @param {string} string | 293 * @param {string} string |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 /** | 326 /** |
315 * @return {?WebInspector.ParsedURL} | 327 * @return {?WebInspector.ParsedURL} |
316 */ | 328 */ |
317 String.prototype.asParsedURL = function() | 329 String.prototype.asParsedURL = function() |
318 { | 330 { |
319 var parsedURL = new WebInspector.ParsedURL(this.toString()); | 331 var parsedURL = new WebInspector.ParsedURL(this.toString()); |
320 if (parsedURL.isValid) | 332 if (parsedURL.isValid) |
321 return parsedURL; | 333 return parsedURL; |
322 return null; | 334 return null; |
323 } | 335 } |
OLD | NEW |