summaryrefslogtreecommitdiffstats
path: root/WebCore/inspector/front-end/InjectedScriptAccess.js
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/inspector/front-end/InjectedScriptAccess.js')
-rw-r--r--WebCore/inspector/front-end/InjectedScriptAccess.js25
1 files changed, 22 insertions, 3 deletions
diff --git a/WebCore/inspector/front-end/InjectedScriptAccess.js b/WebCore/inspector/front-end/InjectedScriptAccess.js
index 14a3a6b..2dd2908 100644
--- a/WebCore/inspector/front-end/InjectedScriptAccess.js
+++ b/WebCore/inspector/front-end/InjectedScriptAccess.js
@@ -29,11 +29,25 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-var InjectedScriptAccess = {};
+function InjectedScriptAccess(injectedScriptId) {
+ this._injectedScriptId = injectedScriptId;
+}
+
+InjectedScriptAccess.get = function(injectedScriptId)
+{
+ return new InjectedScriptAccess(injectedScriptId);
+}
+
+InjectedScriptAccess.getDefault = function()
+{
+ return InjectedScriptAccess.get(0);
+}
+
+InjectedScriptAccess.prototype = {};
InjectedScriptAccess._installHandler = function(methodName, async)
{
- InjectedScriptAccess[methodName] = function()
+ InjectedScriptAccess.prototype[methodName] = function()
{
var allArgs = Array.prototype.slice.call(arguments);
var callback = allArgs[allArgs.length - 1];
@@ -47,7 +61,8 @@ InjectedScriptAccess._installHandler = function(methodName, async)
WebInspector.console.addMessage(new WebInspector.ConsoleTextMessage("Error dispatching: " + methodName));
}
var callId = WebInspector.Callback.wrap(myCallback);
- InspectorBackend.dispatchOnInjectedScript(callId, methodName, argsString, !!async);
+
+ InspectorBackend.dispatchOnInjectedScript(callId, this._injectedScriptId, methodName, argsString, !!async);
};
}
@@ -59,11 +74,13 @@ InjectedScriptAccess._installHandler("addInspectedNode");
InjectedScriptAccess._installHandler("addStyleSelector");
InjectedScriptAccess._installHandler("applyStyleRuleText");
InjectedScriptAccess._installHandler("applyStyleText");
+InjectedScriptAccess._installHandler("clearConsoleMessages");
InjectedScriptAccess._installHandler("evaluate");
InjectedScriptAccess._installHandler("evaluateInCallFrame");
InjectedScriptAccess._installHandler("getCompletions");
InjectedScriptAccess._installHandler("getComputedStyle");
InjectedScriptAccess._installHandler("getInlineStyle");
+InjectedScriptAccess._installHandler("getNodePropertyValue");
InjectedScriptAccess._installHandler("getProperties");
InjectedScriptAccess._installHandler("getPrototypes");
InjectedScriptAccess._installHandler("getStyles");
@@ -72,10 +89,12 @@ InjectedScriptAccess._installHandler("performSearch");
InjectedScriptAccess._installHandler("pushNodeToFrontend");
InjectedScriptAccess._installHandler("nodeByPath");
InjectedScriptAccess._installHandler("searchCanceled");
+InjectedScriptAccess._installHandler("setOuterHTML");
InjectedScriptAccess._installHandler("setPropertyValue");
InjectedScriptAccess._installHandler("setStyleProperty");
InjectedScriptAccess._installHandler("setStyleText");
InjectedScriptAccess._installHandler("toggleStyleEnabled");
+InjectedScriptAccess._installHandler("evaluateOnSelf");
// Some methods can't run synchronously even on the injected script side (such as DB transactions).
// Mark them as asynchronous here.