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

Side by Side Diff: Source/devtools/front_end/common/ParsedURL.js

Issue 1311693004: [DevTools] UI for blocked URLs. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: typo Created 5 years, 3 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 /* 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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 { 247 {
248 return this.scheme === "data"; 248 return this.scheme === "data";
249 }, 249 },
250 250
251 /** 251 /**
252 * @return {string} 252 * @return {string}
253 */ 253 */
254 lastPathComponentWithFragment: function() 254 lastPathComponentWithFragment: function()
255 { 255 {
256 return this.lastPathComponent + (this.fragment ? "#" + this.fragment : "" ); 256 return this.lastPathComponent + (this.fragment ? "#" + this.fragment : "" );
257 } 257 },
258
259 /**
260 * @return {string}
261 */
262 domain: function()
263 {
264 return this.host + (this.port ? ":" + this.port : "");
265 },
266
267 /**
268 * @return {string}
269 */
270 urlWithoutScheme: function()
271 {
272 if (this.scheme && this.url.startsWith(this.scheme + "://"))
273 return this.url.substring(this.scheme.length + 3);
274 return this.url;
275 },
258 } 276 }
259 277
260 /** 278 /**
261 * @param {string} string 279 * @param {string} string
262 * @return {!{url: string, lineNumber: (number|undefined), columnNumber: (number |undefined)}} 280 * @return {!{url: string, lineNumber: (number|undefined), columnNumber: (number |undefined)}}
263 */ 281 */
264 WebInspector.ParsedURL.splitLineAndColumn = function(string) 282 WebInspector.ParsedURL.splitLineAndColumn = function(string)
265 { 283 {
266 var lineColumnRegEx = /(?::(\d+))?(?::(\d+))?$/; 284 var lineColumnRegEx = /(?::(\d+))?(?::(\d+))?$/;
267 var lineColumnMatch = lineColumnRegEx.exec(string); 285 var lineColumnMatch = lineColumnRegEx.exec(string);
(...skipping 17 matching lines...) Expand all
285 /** 303 /**
286 * @return {?WebInspector.ParsedURL} 304 * @return {?WebInspector.ParsedURL}
287 */ 305 */
288 String.prototype.asParsedURL = function() 306 String.prototype.asParsedURL = function()
289 { 307 {
290 var parsedURL = new WebInspector.ParsedURL(this.toString()); 308 var parsedURL = new WebInspector.ParsedURL(this.toString());
291 if (parsedURL.isValid) 309 if (parsedURL.isValid)
292 return parsedURL; 310 return parsedURL;
293 return null; 311 return null;
294 } 312 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698