-
Notifications
You must be signed in to change notification settings - Fork 42
Communication overview
Communication between Opera and OperaDriver (and Dragonfly) is done over a protocol called "Scope" (Scope documentation). Scope uses the protobuf format. It has many different services which can be enabled if they are needed, the ones that are used in OperaDriver are available in the protos/
directory.
Note: the UMS proto is different to the others. Each Scope message (apart from the handshake) is a UMS message (one of Command
from driver to Opera, Response
from Opera to driver, Event
for an unrequested message from Opera to driver, and occasionally Error
instead of a Response
when an error occurs) which contains some headers (such as the status of the result) and a payload
field which contains one of the protobuf messages from the other .proto
files.
- Start up a listener on (default) port 7001 (
StpConnectionListener
). - Start Opera with the
-autotestmode
command line argument. This will cause Opera to disable certain dialogs and automatically connect to a server on port 7001 (in the future the port and host will be able to be specified). - OperaDriver then gets a handshake message.
- Once the handshake has been completed the services OperaDriver needs are enabled. (Note: the way services are handled in the Java code is not ideal.)
- Now this setup is done "commands" can be sent to Opera. In the proto files these are defined in the non-standard
service
section. I recommend looking at the prefs service for a simple example: - Events can also be received from Opera. Have a look at the HTTP logger for an example:
http_logger-2.0.proto
-
UmsEventParser.java:139
(which is indirectly called fromStpConnection.java:458
).
Feel free to send me a message if you have any questions.