Index: Source/devtools/front_end/sdk/Target.js |
diff --git a/Source/devtools/front_end/sdk/Target.js b/Source/devtools/front_end/sdk/Target.js |
index c19c290afee15361cda88755320a9f44c40ec6bc..97e82cb1c6c301a2349759b2d40066e4537aa6e9 100644 |
--- a/Source/devtools/front_end/sdk/Target.js |
+++ b/Source/devtools/front_end/sdk/Target.js |
@@ -10,11 +10,13 @@ |
* @param {string} name |
* @param {!InspectorBackendClass.Connection} connection |
* @param {function(?WebInspector.Target)=} callback |
+ * @param {string=} url |
*/ |
-WebInspector.Target = function(name, connection, callback) |
+WebInspector.Target = function(name, connection, callback, url) |
{ |
Protocol.Agents.call(this, connection.agentsMap()); |
this._name = name; |
+ this._url = url; |
this._connection = connection; |
connection.addEventListener(InspectorBackendClass.Connection.Events.Disconnected, this._onDisconnect, this); |
this._id = WebInspector.Target._nextId++; |
@@ -87,6 +89,15 @@ WebInspector.Target.prototype = { |
}, |
/** |
+ * |
+ * @return {string} |
+ */ |
+ url: function() |
+ { |
+ return this._url ? this._url : this.resourceTreeModel.inspectedPageURL(); |
+ }, |
+ |
+ /** |
* @param {string} name |
* @param {function()|null} callback |
* @param {?Protocol.Error} error |
@@ -445,10 +456,11 @@ WebInspector.TargetManager.prototype = { |
* @param {string} name |
* @param {!InspectorBackendClass.Connection} connection |
* @param {function(?WebInspector.Target)=} callback |
+ * @param {string=} url |
*/ |
- createTarget: function(name, connection, callback) |
+ createTarget: function(name, connection, callback, url) |
{ |
- var target = new WebInspector.Target(name, connection, callbackWrapper.bind(this)); |
+ var target = new WebInspector.Target(name, connection, callbackWrapper.bind(this), url); |
/** |
* @this {WebInspector.TargetManager} |