public class ScopeEcmascriptService extends AbstractEcmascriptService implements Ecmascript
ScopeEcmascriptDebugger it does not disable JIT.activeWindowId, currentFramePath, driver, retries, root, sleepDuration, windowManagerservicesSERVICE_NAMESERVICE_NAME| Constructor and Description |
|---|
ScopeEcmascriptService(ScopeServices services) |
| Modifier and Type | Method and Description |
|---|---|
void |
addRuntime(EsdbgProtos.RuntimeInfo info)
Adds a runtime to the list of runtimes maintained in the service (STP/1 only)
|
String |
callFunctionOnObject(String using,
int objectId)
The script to be executed on/using an object
|
Object |
callFunctionOnObject(String using,
int objectId,
boolean responseExpected) |
void |
changeRuntime(int index)
Changes the frame by index
|
void |
changeRuntime(String frameName)
Changes the frame by frame name address nested frames by dot (first.second)
|
void |
cleanUpRuntimes(int windowId)
Cleanup possible dead/suspended runtimes on runtime-started or window-closed
|
protected void |
createAllRuntimes()
Gets a list of runtimes and keeps the list, create runtimes for all pages so even if the pages
don't have script we can still inject to a 'fake' runtime.
|
List<Integer> |
examineObjects(Integer id)
Request additional information about an object, such as its prototype or its properties.
|
Object |
examineScriptResult(Integer id)
Recursively iterates through the property hierarchies of underneath the given object and
unwraps the node elements into suitable types.
|
String |
executeJavascript(String using,
Integer windowId)
Executes an arbitrary block of JavaScript on a given window, and returns the result of the
evaluation.
|
Object |
executeScript(String using,
boolean responseExpected)
Executes a script and returns the response (based on responseExpected)
|
Integer |
executeScriptOnObject(String using,
int objectId) |
protected EcmascriptProtos.Runtime |
findRuntime()
Find the runtime for injection (default).
|
protected EcmascriptProtos.Runtime |
findRuntime(int windowId) |
Integer |
getObject(String using)
Gets the object id using a script
|
int |
getRuntimeId()
Get the current runtime ID.
|
void |
init()
Initialize the service.
|
List<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()
Resets the frame path context to the top level frame and reinitializes the debugger runtime.
|
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
|
Object |
scriptExecutor(String script,
Object... params)
Executes the given javascript via eval call
|
void |
setFormElementValue(int objectId,
String value)
Set value of a form element.
|
void |
setRuntime(EcmascriptProtos.Runtime runtime) |
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)
|
buildEvalString, cleanUpRuntimes, executeJavascript, executeJavascript, isNumber, isScriptInjectable, parseNumber, processArgument, recover, resetCounters, setDriverbuildPayload, executeMessage, executeMessage, executeMessage, getServiceName, getServiceVersion, isVersionInRange, sleep, toString, xpathIterator, xpathPointerclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcleanUpRuntimes, executeJavascript, executeJavascript, isScriptInjectable, setDrivergetServiceName, getServiceVersionpublic ScopeEcmascriptService(ScopeServices services)
public int getRuntimeId()
DebuggergetRuntimeId in interface Debuggerpublic void setRuntime(EcmascriptProtos.Runtime runtime)
public void setRuntime(EsdbgProtos.RuntimeInfo runtime)
DebuggersetRuntime in interface Debuggerpublic void addRuntime(EsdbgProtos.RuntimeInfo info)
DebuggeraddRuntime in interface Debuggerpublic void removeRuntime(int runtimeId)
DebuggerremoveRuntime in interface Debuggerpublic void init()
Servicepublic boolean updateRuntime()
DebuggerupdateRuntime in interface Debuggerprotected void createAllRuntimes()
public Object scriptExecutor(String script, Object... params)
DebuggerscriptExecutor in interface Debuggerscript - the script to be executed on hostparams - array of params, can be string, long or web element(s)public Object executeScript(String using, boolean responseExpected)
DebuggerexecuteScript in interface Debuggerusing - the script to be injectedresponseExpected - the flag to enable/disable parsing responsenull otherwisepublic Integer getObject(String using)
Debuggerpublic String callFunctionOnObject(String using, int objectId)
DebuggercallFunctionOnObject in interface Debuggerusing - script with reference to the object "locator"objectId - the object to be used for injectionpublic Object callFunctionOnObject(String using, int objectId, boolean responseExpected)
callFunctionOnObject in interface Debuggerpublic Integer executeScriptOnObject(String using, int objectId)
executeScriptOnObject in interface Debuggerpublic void setFormElementValue(int objectId,
String value)
DebuggersetFormElementValue in interface DebuggerobjectId - the ID of the object to set valuevalue - the value to setprotected EcmascriptProtos.Runtime findRuntime()
protected EcmascriptProtos.Runtime findRuntime(int windowId)
public void changeRuntime(int index)
DebuggerchangeRuntime in interface Debuggerpublic void changeRuntime(String frameName)
DebuggerchangeRuntime in interface Debuggerpublic void cleanUpRuntimes(int windowId)
DebuggercleanUpRuntimes in interface Debuggerpublic List<Integer> examineObjects(Integer id)
DebuggerexamineObjects in interface Debuggerid - object ID previously returned from an eval call to the debuggerpublic List<String> listFramePaths()
DebuggerlistFramePaths in interface DebuggerList of String framepathspublic void releaseObjects()
DebuggerreleaseObjects in interface Debuggerpublic void resetRuntimesList()
DebuggerresetRuntimesList in interface Debuggerpublic void readyStateChanged(EcmascriptProtos.ReadyStateChange change)
DebuggerreadyStateChanged in interface Debuggerchange - EcmascriptProtos.ReadyStateChange
object with runtime infopublic void releaseObject(int objectId)
DebuggerreleaseObject in interface DebuggerobjectId - Id of the object to be releasedpublic void resetFramePath()
DebuggerresetFramePath in interface Debuggerpublic String executeJavascript(String using, Integer windowId)
DebuggerexecuteJavascript in interface Debuggerusing - the code to evaluatewindowId - the runtime ID, previously retrieved from the WindowManagerpublic Object examineScriptResult(Integer id)
DebuggerOperaWebElement's, arrays into
Java List's, hashes into Map's, numbers into Integer's, and
the remaining properties into String's.examineScriptResult in interface Debuggerid - the object to examine the hierarchy ofCopyright © 2013. All Rights Reserved.