com.opera.core.systems.scope.services
Interface IEcmaScriptDebugger

All Known Implementing Classes:
EcmaScriptDebugger, EcmaScriptDebugger6, EcmascriptService

public interface IEcmaScriptDebugger


Method Summary
 void addRuntime(EsdbgProtos.RuntimeInfo info)
          Adds a runtime to the list of runtimes maintained in the service (STP/1 only)
 java.lang.String callFunctionOnObject(java.lang.String using, int objectId)
          The script to be executed on/using an object
 java.lang.Object callFunctionOnObject(java.lang.String using, int objectId, boolean responseExpected)
           
 void changeRuntime(int index)
          Changes the frame by index
 void changeRuntime(java.lang.String frameName)
          Changes the frame by frame name address nested frames by dot (first.second)
 void cleanUpRuntimes()
          Cleanup runtimes with the active window id
 void cleanUpRuntimes(int windowId)
          Cleanup possible dead/suspended runtimes on runtime-started or window-closed
 java.util.List<java.lang.Integer> examineObjects(java.lang.Integer id)
           
 java.lang.Object examineScriptResult(java.lang.Integer id)
           
 java.lang.String executeJavascript(java.lang.String using)
          Execute a script and wait for response
 java.lang.String executeJavascript(java.lang.String using, boolean responseExpected)
          Execute a script, this method allows fine tuning of responses, we are not interested in return value in some injections
 java.lang.String executeJavascript(java.lang.String using, java.lang.Integer windowId)
           
 java.lang.Object executeScript(java.lang.String using, boolean responseExpected)
          Executes a script and returns the response (based on responseExpected)
 java.lang.Integer executeScriptOnObject(java.lang.String using, int objectId)
           
 java.lang.Integer getObject(java.lang.String using)
          Gets the object id using a script
 int getRuntimeId()
           
 void init()
          Initialize the debugger, set the configuration to NOT stop on error, exception, script or abort Create all runtimes and find a suitable runtime for injection (Currently has a workaround or 'return 1;' for GOGI dialog at opera:debug)
 java.util.List<java.lang.String> listFramePaths()
          Lists the frame paths of available runtimes
 void readyStateChanged(EcmascriptProtos.ReadyStateChange change)
          Triggered on the ecmascript service when the state of a runtime changes
 void releaseObject(int objectId)
          Releases a specific object
 void releaseObjects()
          Makes objects available to gc, this doesn't free the objects immediately
 void removeRuntime(int runtimeId)
          Removes a runtime from the list, doesnt get called often due to runtime-stopped being sent late (runtimes get suspended)
 void resetFramePath()
           
 void resetRuntimesList()
          Resets the list of runtimes and fetches a fresh list from Opera, this can be used to recover in cases where runtimes go out of sync
 java.lang.Object scriptExecutor(java.lang.String script, java.lang.Object... params)
          Executes the given javascript via eval call
 void setDriver(OperaDriver driver)
          Set the driver this service belongs to.
 void setRuntime(EsdbgProtos.RuntimeInfo runtime)
          Sets the runtime to be used in injection required for event handler (STP/1 only)
 boolean updateRuntime()
          Finds a valid runtime and updates the runtime reference (active runtime)
 

Method Detail

setDriver

void setDriver(OperaDriver driver)
Set the driver this service belongs to. Needed so that we can create OperaWebElements in this service.


getRuntimeId

int getRuntimeId()

setRuntime

void setRuntime(EsdbgProtos.RuntimeInfo runtime)
Sets the runtime to be used in injection required for event handler (STP/1 only)


removeRuntime

void removeRuntime(int runtimeId)
Removes a runtime from the list, doesnt get called often due to runtime-stopped being sent late (runtimes get suspended)


addRuntime

void addRuntime(EsdbgProtos.RuntimeInfo info)
Adds a runtime to the list of runtimes maintained in the service (STP/1 only)


init

void init()
Initialize the debugger, set the configuration to NOT stop on error, exception, script or abort Create all runtimes and find a suitable runtime for injection (Currently has a workaround or 'return 1;' for GOGI dialog at opera:debug)


scriptExecutor

java.lang.Object scriptExecutor(java.lang.String script,
                                java.lang.Object... params)
Executes the given javascript via eval call

Parameters:
script - The script to be executed on host
params - Array of params, can be string, long or web element(s)

executeJavascript

java.lang.String executeJavascript(java.lang.String using)
Execute a script and wait for response

Parameters:
using - script to execute

executeJavascript

java.lang.String executeJavascript(java.lang.String using,
                                   boolean responseExpected)
Execute a script, this method allows fine tuning of responses, we are not interested in return value in some injections

Parameters:
using - script to execute
responseExpected - if true parse the response
Returns:
String representation of the response

executeScript

java.lang.Object executeScript(java.lang.String using,
                               boolean responseExpected)
Executes a script and returns the response (based on responseExpected)

Parameters:
using - The script to be injected
responseExpected - The flag to enable/disable parsing response
Returns:
The raw result object if response is expected, null otherwise

getObject

java.lang.Integer getObject(java.lang.String using)
Gets the object id using a script

Parameters:
using - the script to find the object
Returns:
object id with the result

callFunctionOnObject

java.lang.String callFunctionOnObject(java.lang.String using,
                                      int objectId)
The script to be executed on/using an object

Parameters:
using - Script with reference to the object "locator"
objectId - The object to be used for injection
Returns:
The string value returned by the executed Javascript

callFunctionOnObject

java.lang.Object callFunctionOnObject(java.lang.String using,
                                      int objectId,
                                      boolean responseExpected)

executeScriptOnObject

java.lang.Integer executeScriptOnObject(java.lang.String using,
                                        int objectId)

changeRuntime

void changeRuntime(int index)
Changes the frame by index


changeRuntime

void changeRuntime(java.lang.String frameName)
Changes the frame by frame name address nested frames by dot (first.second)


cleanUpRuntimes

void cleanUpRuntimes(int windowId)
Cleanup possible dead/suspended runtimes on runtime-started or window-closed


cleanUpRuntimes

void cleanUpRuntimes()
Cleanup runtimes with the active window id


examineObjects

java.util.List<java.lang.Integer> examineObjects(java.lang.Integer id)

listFramePaths

java.util.List<java.lang.String> listFramePaths()
Lists the frame paths of available runtimes

Returns:
a List of String framepaths

releaseObjects

void releaseObjects()
Makes objects available to gc, this doesn't free the objects immediately


updateRuntime

boolean updateRuntime()
Finds a valid runtime and updates the runtime reference (active runtime)

Returns:
true if a runtime is found and updated

resetRuntimesList

void resetRuntimesList()
Resets the list of runtimes and fetches a fresh list from Opera, this can be used to recover in cases where runtimes go out of sync


readyStateChanged

void readyStateChanged(EcmascriptProtos.ReadyStateChange change)
Triggered on the ecmascript service when the state of a runtime changes

Parameters:
change - EcmascriptProtos.ReadyStateChange object with runtime info

releaseObject

void releaseObject(int objectId)
Releases a specific object

Parameters:
objectId - Id of the object to be released

resetFramePath

void resetFramePath()

executeJavascript

java.lang.String executeJavascript(java.lang.String using,
                                   java.lang.Integer windowId)

examineScriptResult

java.lang.Object examineScriptResult(java.lang.Integer id)


Copyright © 2011. All Rights Reserved.