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

Unified Diff: third_party/WebKit/Source/devtools/front_end/components/Linkifier.js

Issue 1805763002: [DevTools] Do not linkify relative urls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/components/Linkifier.js
diff --git a/third_party/WebKit/Source/devtools/front_end/components/Linkifier.js b/third_party/WebKit/Source/devtools/front_end/components/Linkifier.js
index 439eefdb3027728d4f6672b172ba6263033e54c6..9aa7b627866a513a427ae5cc596e0730bdf8d1aa 100644
--- a/third_party/WebKit/Source/devtools/front_end/components/Linkifier.js
+++ b/third_party/WebKit/Source/devtools/front_end/components/Linkifier.js
@@ -513,12 +513,17 @@ WebInspector.linkifyURLAsNode = function(url, linkText, classes, isExternal, too
if (!linkText)
linkText = url;
classes = (classes ? classes + " " : "");
- classes += isExternal ? "webkit-html-external-link" : "webkit-html-resource-link";
var a = createElement("a");
- var href = sanitizeHref(url);
- if (href !== null)
+ var href = url;
+ if (url.trim().toLowerCase().startsWith("javascript:"))
+ href = null;
+ if (isExternal && WebInspector.ParsedURL.isRelativeURL(url))
+ href = null;
+ if (href !== null) {
a.href = href;
+ classes += isExternal ? "webkit-html-external-link" : "webkit-html-resource-link";
+ }
a.className = classes;
if (!tooltipText && linkText !== url)
a.title = url;

Powered by Google App Engine
This is Rietveld 408576698