1. We should not be doing match[2] all over the code to extract the domain 2. We currently rely on backend to calculate host, port, lastPathComponent and such, but they can areally be cracked on the front-end side.
Created attachment 70958 [details] [PATCH] Proposed change.
Created attachment 70959 [details] [PATCH] Same with layout tests not using old regex.
Comment on attachment 70959 [details] [PATCH] Same with layout tests not using old regex. View in context: https://bugs.webkit.org/attachment.cgi?id=70959&action=review > WebCore/inspector/front-end/utilities.js:396 > +String.prototype.asParsedURL = function() I'd rather make it a function, not a method. > WebCore/inspector/front-end/utilities.js:413 > + return result; You may want to cache result on the String object.
Committing to http://svn.webkit.org/repository/webkit/trunk ... M LayoutTests/inspector/elements-panel-rewrite-href.html M WebCore/ChangeLog M WebCore/inspector/InspectorResource.cpp M WebCore/inspector/front-end/AuditRules.js M WebCore/inspector/front-end/CookieItemsView.js M WebCore/inspector/front-end/DOMAgent.js M WebCore/inspector/front-end/Resource.js M WebCore/inspector/front-end/ResourceCategory.js M WebCore/inspector/front-end/ResourceView.js M WebCore/inspector/front-end/inspector.js M WebCore/inspector/front-end/utilities.js Committed r69947