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

Unified Diff: Source/devtools/front_end/console/ConsoleView.js

Issue 468123002: DevTools: Fix displayName for workers in console selector (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/console/ConsoleView.js
diff --git a/Source/devtools/front_end/console/ConsoleView.js b/Source/devtools/front_end/console/ConsoleView.js
index e34354b2b225cfad48ea2fe14284096e959ed3cc..576d45206233d0fcf99c7a0eff4118a40b112721 100644
--- a/Source/devtools/front_end/console/ConsoleView.js
+++ b/Source/devtools/front_end/console/ConsoleView.js
@@ -282,14 +282,16 @@ WebInspector.ConsoleView.prototype = {
*/
_titleFor: function(executionContext)
{
- var result = executionContext.name;
- if (executionContext.isMainWorldContext && executionContext.frameId) {
- var frame = executionContext.target().resourceTreeModel.frameForId(executionContext.frameId);
- result = frame ? frame.displayName() : result;
- }
-
- if (!executionContext.isMainWorldContext)
- result = "\u00a0\u00a0\u00a0\u00a0" + result;
+ var result;
+ if (executionContext.isMainWorldContext) {
+ if (executionContext.frameId) {
+ var frame = executionContext.target().resourceTreeModel.frameForId(executionContext.frameId);
+ result = frame ? frame.displayName() : executionContext.name;
+ } else {
+ result = WebInspector.displayNameForURL(executionContext.name)
+ }
+ } else
+ result = "\u00a0\u00a0\u00a0\u00a0" + executionContext.name;
var maxLength = 50;
return result.trimMiddle(maxLength);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698