Skip to content

Instantly share code, notes, and snippets.

@titusfortner
Last active September 21, 2019 08:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save titusfortner/98c10d611c317ea57ad96895870be036 to your computer and use it in GitHub Desktop.
Save titusfortner/98c10d611c317ea57ad96895870be036 to your computer and use it in GitHub Desktop.
Script Pinning
Scripts
A script is an abstraction used to identify a String of code that can be executed when it is transported via the protocol, between remote and local ends.
Each script has an associated script name that uniquely identifies the script across all browsing contexts. It must be a string, and should be the result of generating a UUID.
Each session maintains a list of known scripts. This list is initially empty. When a script name is added to the list of known scripts, a corresponding entry is made in the script names table where the key is the script name and the value is the provided script. When an input source is removed from the list of active input sources, the corresponding entry in the input state table is also removed.
15.1.2
To get a known script with argument name, run the following steps:
Let script be the item in the current session list of known scripts for which the script name matches name, if such an script exists. Otherwise return error with error code no such script.
Return success with script.
Let script be the result of getting a property named script from the parameters:
If script is set and name is set, return error with error code invalid argument.
If name is set Let script be the result of trying to get a known script with a script name of name
POST /session/{session id}/execute/sync/{?name}
POST /session/{session id}/execute/async/{?name}
Pin Script
POST /session/{session id}/execute/pin
The remote end steps are:
Let script be the result of getting a property named script from the parameters argument.
If script is undefined or is not a String, return error with error code invalid argument.
Let script name be the result of getting a property named name from the parameters argument.
If the current browsing context is no longer open, return error with error code no such window.
If a known script name equals name, remove the script name from known scripts.
Add script name to the list of known scripts for the current session.
no such script 404 no such script No script matching the given script name was found amongst the list of known scripts of the current session.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment