sentence1
stringlengths 52
3.87M
| sentence2
stringlengths 1
47.2k
| label
stringclasses 1
value |
---|---|---|
def format_tsv_line(source, edge, target, value=None, metadata=None):
"""
Render a single line for TSV file with data flow described
:type source str
:type edge str
:type target str
:type value float
:type metadata str
:rtype: str
"""
return '{source}\t{edge}\t{target}\t{value}\t{metadata}'.format(
source=source,
edge=edge,
target=target,
value='{:.4f}'.format(value) if value is not None else '',
metadata=metadata or ''
).rstrip(' \t') | Render a single line for TSV file with data flow described
:type source str
:type edge str
:type target str
:type value float
:type metadata str
:rtype: str | entailment |
def format_graphviz_lines(lines):
"""
Render a .dot file with graph definition from a given set of data
:type lines list[dict]
:rtype: str
"""
# first, prepare the unique list of all nodes (sources and targets)
lines_nodes = set()
for line in lines:
lines_nodes.add(line['source'])
lines_nodes.add(line['target'])
# generate a list of all nodes and their names for graphviz graph
nodes = OrderedDict()
for i, node in enumerate(sorted(lines_nodes)):
nodes[node] = 'n{}'.format(i+1)
# print(lines_nodes, nodes)
graph = list()
# some basic style definition
# https://graphviz.gitlab.io/_pages/doc/info/lang.html
graph.append('digraph G {')
# https://graphviz.gitlab.io/_pages/doc/info/shapes.html#record
graph.append('\tgraph [ center=true, margin=0.75, nodesep=0.5, ranksep=0.75, rankdir=LR ];')
graph.append('\tnode [ shape=box, style="rounded,filled" width=0, height=0, '
'fontname=Helvetica, fontsize=11 ];')
graph.append('\tedge [ fontname=Helvetica, fontsize=9 ];')
# emit nodes definition
graph.append('\n\t// nodes')
# https://www.graphviz.org/doc/info/colors.html#brewer
group_colors = dict()
for label, name in nodes.items():
if ':' in label:
(group, label) = str(label).split(':', 1)
# register a new group for coloring
if group not in group_colors:
group_colors[group] = len(group_colors.keys()) + 1
else:
group = None
label = escape_graphviz_entry(label)
graph.append('\t{name} [label="{label}"{group}];'.format(
name=name,
label="{}\\n{}".format(group, label) if group is not None else label,
group=' group="{}" colorscheme=pastel28 color={}'.format(
group, group_colors[group]) if group is not None else ''
))
# now, connect the nodes
graph.append('\n\t// edges')
for line in lines:
label = line.get('metadata', '')
graph.append('\t{source} -> {target} [{label}];'.format(
source=nodes[line['source']],
target=nodes[line['target']],
label='label="{}"'.format(escape_graphviz_entry(label)) if label != '' else ''
))
graph.append('}')
return '\n'.join(graph) | Render a .dot file with graph definition from a given set of data
:type lines list[dict]
:rtype: str | entailment |
def logs_map_and_reduce(logs, _map, _reduce):
"""
:type logs str[]
:type _map (list) -> str
:type _reduce (list) -> obj
"""
keys = []
mapped_count = Counter()
mapped = defaultdict(list)
# first map all entries
for log in logs:
key = _map(log)
mapped[key].append(log)
mapped_count[key] += 1
if key not in keys:
keys.append(key)
# the most common mapped item
top_count = mapped_count.most_common(1).pop()[1]
# now reduce mapped items
reduced = []
# keep the order under control
for key in keys:
entries = mapped[key]
# print(key, entries)
# add "value" field to each reduced item (1.0 will be assigned to the most "common" item)
item = _reduce(entries)
item['value'] = 1. * len(entries) / top_count
reduced.append(item)
# print(mapped)
return reduced | :type logs str[]
:type _map (list) -> str
:type _reduce (list) -> obj | entailment |
def close_chromium(self):
'''
Close the remote chromium instance.
This command is normally executed as part of the class destructor.
It can be called early without issue, but calling ANY class functions
after the remote chromium instance is shut down will have unknown effects.
Note that if you are rapidly creating and destroying ChromeController instances,
you may need to *explicitly* call this before destruction.
'''
if self.cr_proc:
try:
if 'win' in sys.platform:
self.__close_internal_windows()
else:
self.__close_internal_linux()
except Exception as e:
for line in traceback.format_exc().split("\n"):
self.log.error(line)
ACTIVE_PORTS.discard(self.port) | Close the remote chromium instance.
This command is normally executed as part of the class destructor.
It can be called early without issue, but calling ANY class functions
after the remote chromium instance is shut down will have unknown effects.
Note that if you are rapidly creating and destroying ChromeController instances,
you may need to *explicitly* call this before destruction. | entailment |
def connect(self, tab_key):
"""
Open a websocket connection to remote browser, determined by
self.host and self.port. Each tab has it's own websocket
endpoint.
"""
assert self.tablist is not None
tab_idx = self._get_tab_idx_for_key(tab_key)
if not self.tablist:
self.tablist = self.fetch_tablist()
for fails in range(9999):
try:
# If we're one past the end of the tablist, we need to create a new tab
if tab_idx is None:
self.log.debug("Creating new tab (%s active)", len(self.tablist))
self.__create_new_tab(tab_key)
self.__connect_to_tab(tab_key)
break
except cr_exceptions.ChromeConnectFailure as e:
if fails > 6:
self.log.error("Failed to fetch tab websocket URL after %s retries. Aborting!", fails)
raise e
self.log.info("Tab may not have started yet (%s tabs active). Recreating.", len(self.tablist))
# self.log.info("Tag: %s", self.tablist[tab_idx])
# For reasons I don't understand, sometimes a new tab doesn't get a websocket
# debugger URL. Anyways, we close and re-open the tab if that happens.
# TODO: Handle the case when this happens on the first tab. I think closing the first
# tab will kill chromium.
self.__close_tab(tab_key) | Open a websocket connection to remote browser, determined by
self.host and self.port. Each tab has it's own websocket
endpoint. | entailment |
def close_websockets(self):
""" Close websocket connection to remote browser."""
self.log.info("Websocket Teardown called")
for key in list(self.soclist.keys()):
if self.soclist[key]:
self.soclist[key].close()
self.soclist.pop(key) | Close websocket connection to remote browser. | entailment |
def fetch_tablist(self):
"""Connect to host:port and request list of tabs
return list of dicts of data about open tabs."""
# find websocket endpoint
try:
response = requests.get("http://%s:%s/json" % (self.host, self.port))
except requests.exceptions.ConnectionError:
raise cr_exceptions.ChromeConnectFailure("Failed to fetch configuration json from browser!")
tablist = json.loads(response.text)
return tablist | Connect to host:port and request list of tabs
return list of dicts of data about open tabs. | entailment |
def synchronous_command(self, command, tab_key, **params):
"""
Synchronously execute command `command` with params `params` in the
remote chrome instance, returning the response from the chrome instance.
"""
self.log.debug("Synchronous_command to tab %s (%s):", tab_key, self._get_cr_tab_meta_for_key(tab_key))
self.log.debug(" command: '%s'", command)
self.log.debug(" params: '%s'", params)
self.log.debug(" tab_key: '%s'", tab_key)
send_id = self.send(command=command, tab_key=tab_key, params=params)
resp = self.recv(message_id=send_id, tab_key=tab_key)
self.log.debug(" Response: '%s'", str(resp).encode("ascii", 'ignore').decode("ascii"))
# self.log.debug(" resolved tab idx %s:", self.tab_id_map[tab_key])
return resp | Synchronously execute command `command` with params `params` in the
remote chrome instance, returning the response from the chrome instance. | entailment |
def send(self, command, tab_key, params=None):
'''
Send command `command` with optional parameters `params` to the
remote chrome instance.
The command `id` is automatically added to the outgoing message.
return value is the command id, which can be used to match a command
to it's associated response.
'''
self.__check_open_socket(tab_key)
sent_id = self.msg_id
command = {
"id": self.msg_id,
"method": command,
}
if params:
command["params"] = params
navcom = json.dumps(command)
# self.log.debug(" Sending: '%s'", navcom)
try:
self.soclist[tab_key].send(navcom)
except (socket.timeout, websocket.WebSocketTimeoutException):
raise cr_exceptions.ChromeCommunicationsError("Failure sending command to chromium.")
except websocket.WebSocketConnectionClosedException:
raise cr_exceptions.ChromeCommunicationsError("Websocket appears to have been closed. Is the"
" remote chromium instance dead?")
self.msg_id += 1
return sent_id | Send command `command` with optional parameters `params` to the
remote chrome instance.
The command `id` is automatically added to the outgoing message.
return value is the command id, which can be used to match a command
to it's associated response. | entailment |
def recv_filtered(self, keycheck, tab_key, timeout=30, message=None):
'''
Receive a filtered message, using the callable `keycheck` to filter received messages
for content.
`keycheck` is expected to be a callable that takes a single parameter (the decoded response
from chromium), and returns a boolean (true, if the command is the one filtered for, or false
if the command is not the one filtered for).
This is used internally, for example, by `recv()`, to filter the response for a specific ID:
```
def check_func(message):
if message_id is None:
return True
if "id" in message:
return message['id'] == message_id
return False
return self.recv_filtered(check_func, timeout)
```
Note that the function is defined dynamically, and `message_id` is captured via closure.
'''
self.__check_open_socket(tab_key)
# First, check if the message has already been received.
for idx in range(len(self.messages[tab_key])):
if keycheck(self.messages[tab_key][idx]):
return self.messages[tab_key].pop(idx)
timeout_at = time.time() + timeout
while 1:
tmp = self.___recv(tab_key)
if keycheck(tmp):
return tmp
else:
self.messages[tab_key].append(tmp)
if time.time() > timeout_at:
if message:
raise cr_exceptions.ChromeResponseNotReceived("Failed to receive response in recv_filtered() (%s)" % message)
else:
raise cr_exceptions.ChromeResponseNotReceived("Failed to receive response in recv_filtered()")
else:
time.sleep(0.005) | Receive a filtered message, using the callable `keycheck` to filter received messages
for content.
`keycheck` is expected to be a callable that takes a single parameter (the decoded response
from chromium), and returns a boolean (true, if the command is the one filtered for, or false
if the command is not the one filtered for).
This is used internally, for example, by `recv()`, to filter the response for a specific ID:
```
def check_func(message):
if message_id is None:
return True
if "id" in message:
return message['id'] == message_id
return False
return self.recv_filtered(check_func, timeout)
```
Note that the function is defined dynamically, and `message_id` is captured via closure. | entailment |
def recv_all_filtered(self, keycheck, tab_key, timeout=0.5):
'''
Receive a all messages matching a filter, using the callable `keycheck` to filter received messages
for content.
This function will *ALWAY* block for at least `timeout` seconds.
If chromium is for some reason continuously streaming responses, it may block forever!
`keycheck` is expected to be a callable that takes a single parameter (the decoded response
from chromium), and returns a boolean (true, if the command is the one filtered for, or false
if the command is not the one filtered for).
```
def check_func(message):
if message_id is None:
return True
if "id" in message:
return message['id'] == message_id
return False
return self.recv_filtered(check_func, timeout)
```
Note that the function is defined dynamically, and `message_id` is captured via closure.
'''
self.__check_open_socket(tab_key)
# First, check if the message has already been received.
ret = [tmp for tmp in self.messages[tab_key] if keycheck(tmp)]
self.messages[tab_key] = [tmp for tmp in self.messages[tab_key] if not keycheck(tmp)]
self.log.debug("Waiting for all messages from the socket")
timeout_at = time.time() + timeout
while 1:
tmp = self.___recv(tab_key, timeout=timeout)
if keycheck(tmp):
ret.append(tmp)
else:
self.messages[tab_key].append(tmp)
if time.time() > timeout_at:
return ret
else:
self.log.debug("Sleeping: %s, %s" % (timeout_at, time.time()))
time.sleep(0.005) | Receive a all messages matching a filter, using the callable `keycheck` to filter received messages
for content.
This function will *ALWAY* block for at least `timeout` seconds.
If chromium is for some reason continuously streaming responses, it may block forever!
`keycheck` is expected to be a callable that takes a single parameter (the decoded response
from chromium), and returns a boolean (true, if the command is the one filtered for, or false
if the command is not the one filtered for).
```
def check_func(message):
if message_id is None:
return True
if "id" in message:
return message['id'] == message_id
return False
return self.recv_filtered(check_func, timeout)
```
Note that the function is defined dynamically, and `message_id` is captured via closure. | entailment |
def recv(self, tab_key, message_id=None, timeout=30):
'''
Recieve a message, optionally filtering for a specified message id.
If `message_id` is none, the first command in the receive queue is returned.
If `message_id` is not none, the command waits untill a message is received with
the specified id, or it times out.
Timeout is the number of seconds to wait for a response, or `None` if the timeout
has expired with no response.
'''
self.__check_open_socket(tab_key)
# First, check if the message has already been received.
for idx in range(len(self.messages[tab_key])):
if self.messages[tab_key][idx]:
if "id" in self.messages[tab_key][idx] and message_id:
if self.messages[tab_key][idx]['id'] == message_id:
return self.messages[tab_key].pop(idx)
# Then spin untill we either have the message,
# or have timed out.
def check_func(message):
if message_id is None:
return True
if not message:
self.log.debug("Message is not true (%s)!", message)
return False
if "id" in message:
return message['id'] == message_id
return False
return self.recv_filtered(check_func, tab_key, timeout) | Recieve a message, optionally filtering for a specified message id.
If `message_id` is none, the first command in the receive queue is returned.
If `message_id` is not none, the command waits untill a message is received with
the specified id, or it times out.
Timeout is the number of seconds to wait for a response, or `None` if the timeout
has expired with no response. | entailment |
def drain(self, tab_key):
'''
Return all messages in waiting for the websocket connection.
'''
self.log.debug("Draining transport")
ret = []
while len(self.messages[tab_key]):
ret.append(self.messages[tab_key].pop(0))
self.log.debug("Polling socket")
tmp = self.___recv(tab_key)
while tmp is not None:
ret.append(tmp)
tmp = self.___recv(tab_key)
self.log.debug("Drained %s messages", len(ret))
return ret | Return all messages in waiting for the websocket connection. | entailment |
def cli(verbose, silent):
'''
ChromeController
\b
Usage: python3 -m ChromeController [-s | --silent] [-v | --verbose]
python3 -m ChromeController fetch <url> [--binary <bin_name>] [--outfile <out_file_name>]
python3 -m ChromeController update
python3 -m ChromeController (-h | --help)
python3 -m ChromeController --version
\b
Options:
-s --silent Suppress all output aside from the fetched content
This basically makes ChromeController act like a alternative to curl
-v --verbose The opposite of silent. Causes the internal logging to output
all traffic over the chromium control interface. VERY noisy.
--version Show version.
fetch Fetch a specified URL's content, and output it to the console.
'''
if verbose:
logging.basicConfig(level=logging.DEBUG)
elif silent:
logging.basicConfig(level=logging.ERROR)
else:
logging.basicConfig(level=logging.INFO) | ChromeController
\b
Usage: python3 -m ChromeController [-s | --silent] [-v | --verbose]
python3 -m ChromeController fetch <url> [--binary <bin_name>] [--outfile <out_file_name>]
python3 -m ChromeController update
python3 -m ChromeController (-h | --help)
python3 -m ChromeController --version
\b
Options:
-s --silent Suppress all output aside from the fetched content
This basically makes ChromeController act like a alternative to curl
-v --verbose The opposite of silent. Causes the internal logging to output
all traffic over the chromium control interface. VERY noisy.
--version Show version.
fetch Fetch a specified URL's content, and output it to the console. | entailment |
def fetch(url, binary, outfile, noprint, rendered):
'''
Fetch a specified URL's content, and output it to the console.
'''
with chrome_context.ChromeContext(binary=binary) as cr:
resp = cr.blocking_navigate_and_get_source(url)
if rendered:
resp['content'] = cr.get_rendered_page_source()
resp['binary'] = False
resp['mimie'] = 'text/html'
if not noprint:
if resp['binary'] is False:
print(resp['content'])
else:
print("Response is a binary file")
print("Cannot print!")
if outfile:
with open(outfile, "wb") as fp:
if resp['binary']:
fp.write(resp['content'])
else:
fp.write(resp['content'].encode("UTF-8")) | Fetch a specified URL's content, and output it to the console. | entailment |
def Memory_setPressureNotificationsSuppressed(self, suppressed):
"""
Function path: Memory.setPressureNotificationsSuppressed
Domain: Memory
Method name: setPressureNotificationsSuppressed
Parameters:
Required arguments:
'suppressed' (type: boolean) -> If true, memory pressure notifications will be suppressed.
No return value.
Description: Enable/disable suppressing memory pressure notifications in all processes.
"""
assert isinstance(suppressed, (bool,)
), "Argument 'suppressed' must be of type '['bool']'. Received type: '%s'" % type(
suppressed)
subdom_funcs = self.synchronous_command(
'Memory.setPressureNotificationsSuppressed', suppressed=suppressed)
return subdom_funcs | Function path: Memory.setPressureNotificationsSuppressed
Domain: Memory
Method name: setPressureNotificationsSuppressed
Parameters:
Required arguments:
'suppressed' (type: boolean) -> If true, memory pressure notifications will be suppressed.
No return value.
Description: Enable/disable suppressing memory pressure notifications in all processes. | entailment |
def Page_addScriptToEvaluateOnLoad(self, scriptSource):
"""
Function path: Page.addScriptToEvaluateOnLoad
Domain: Page
Method name: addScriptToEvaluateOnLoad
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'scriptSource' (type: string) -> No description
Returns:
'identifier' (type: ScriptIdentifier) -> Identifier of the added script.
Description: Deprecated, please use addScriptToEvaluateOnNewDocument instead.
"""
assert isinstance(scriptSource, (str,)
), "Argument 'scriptSource' must be of type '['str']'. Received type: '%s'" % type(
scriptSource)
subdom_funcs = self.synchronous_command('Page.addScriptToEvaluateOnLoad',
scriptSource=scriptSource)
return subdom_funcs | Function path: Page.addScriptToEvaluateOnLoad
Domain: Page
Method name: addScriptToEvaluateOnLoad
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'scriptSource' (type: string) -> No description
Returns:
'identifier' (type: ScriptIdentifier) -> Identifier of the added script.
Description: Deprecated, please use addScriptToEvaluateOnNewDocument instead. | entailment |
def Page_addScriptToEvaluateOnNewDocument(self, source):
"""
Function path: Page.addScriptToEvaluateOnNewDocument
Domain: Page
Method name: addScriptToEvaluateOnNewDocument
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'source' (type: string) -> No description
Returns:
'identifier' (type: ScriptIdentifier) -> Identifier of the added script.
Description: Evaluates given script in every frame upon creation (before loading frame's scripts).
"""
assert isinstance(source, (str,)
), "Argument 'source' must be of type '['str']'. Received type: '%s'" % type(
source)
subdom_funcs = self.synchronous_command(
'Page.addScriptToEvaluateOnNewDocument', source=source)
return subdom_funcs | Function path: Page.addScriptToEvaluateOnNewDocument
Domain: Page
Method name: addScriptToEvaluateOnNewDocument
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'source' (type: string) -> No description
Returns:
'identifier' (type: ScriptIdentifier) -> Identifier of the added script.
Description: Evaluates given script in every frame upon creation (before loading frame's scripts). | entailment |
def Page_setAutoAttachToCreatedPages(self, autoAttach):
"""
Function path: Page.setAutoAttachToCreatedPages
Domain: Page
Method name: setAutoAttachToCreatedPages
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'autoAttach' (type: boolean) -> If true, browser will open a new inspector window for every page created from this one.
No return value.
Description: Controls whether browser will open a new inspector window for connected pages.
"""
assert isinstance(autoAttach, (bool,)
), "Argument 'autoAttach' must be of type '['bool']'. Received type: '%s'" % type(
autoAttach)
subdom_funcs = self.synchronous_command('Page.setAutoAttachToCreatedPages',
autoAttach=autoAttach)
return subdom_funcs | Function path: Page.setAutoAttachToCreatedPages
Domain: Page
Method name: setAutoAttachToCreatedPages
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'autoAttach' (type: boolean) -> If true, browser will open a new inspector window for every page created from this one.
No return value.
Description: Controls whether browser will open a new inspector window for connected pages. | entailment |
def Page_setAdBlockingEnabled(self, enabled):
"""
Function path: Page.setAdBlockingEnabled
Domain: Page
Method name: setAdBlockingEnabled
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'enabled' (type: boolean) -> Whether to block ads.
No return value.
Description: Enable Chrome's experimental ad filter on all sites.
"""
assert isinstance(enabled, (bool,)
), "Argument 'enabled' must be of type '['bool']'. Received type: '%s'" % type(
enabled)
subdom_funcs = self.synchronous_command('Page.setAdBlockingEnabled',
enabled=enabled)
return subdom_funcs | Function path: Page.setAdBlockingEnabled
Domain: Page
Method name: setAdBlockingEnabled
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'enabled' (type: boolean) -> Whether to block ads.
No return value.
Description: Enable Chrome's experimental ad filter on all sites. | entailment |
def Page_navigateToHistoryEntry(self, entryId):
"""
Function path: Page.navigateToHistoryEntry
Domain: Page
Method name: navigateToHistoryEntry
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'entryId' (type: integer) -> Unique id of the entry to navigate to.
No return value.
Description: Navigates current page to the given history entry.
"""
assert isinstance(entryId, (int,)
), "Argument 'entryId' must be of type '['int']'. Received type: '%s'" % type(
entryId)
subdom_funcs = self.synchronous_command('Page.navigateToHistoryEntry',
entryId=entryId)
return subdom_funcs | Function path: Page.navigateToHistoryEntry
Domain: Page
Method name: navigateToHistoryEntry
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'entryId' (type: integer) -> Unique id of the entry to navigate to.
No return value.
Description: Navigates current page to the given history entry. | entailment |
def Page_deleteCookie(self, cookieName, url):
"""
Function path: Page.deleteCookie
Domain: Page
Method name: deleteCookie
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'cookieName' (type: string) -> Name of the cookie to remove.
'url' (type: string) -> URL to match cooke domain and path.
No return value.
Description: Deletes browser cookie with given name, domain and path.
"""
assert isinstance(cookieName, (str,)
), "Argument 'cookieName' must be of type '['str']'. Received type: '%s'" % type(
cookieName)
assert isinstance(url, (str,)
), "Argument 'url' must be of type '['str']'. Received type: '%s'" % type(
url)
subdom_funcs = self.synchronous_command('Page.deleteCookie', cookieName=
cookieName, url=url)
return subdom_funcs | Function path: Page.deleteCookie
Domain: Page
Method name: deleteCookie
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'cookieName' (type: string) -> Name of the cookie to remove.
'url' (type: string) -> URL to match cooke domain and path.
No return value.
Description: Deletes browser cookie with given name, domain and path. | entailment |
def Page_getResourceContent(self, frameId, url):
"""
Function path: Page.getResourceContent
Domain: Page
Method name: getResourceContent
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'frameId' (type: FrameId) -> Frame id to get resource for.
'url' (type: string) -> URL of the resource to get content for.
Returns:
'content' (type: string) -> Resource content.
'base64Encoded' (type: boolean) -> True, if content was served as base64.
Description: Returns content of the given resource.
"""
assert isinstance(url, (str,)
), "Argument 'url' must be of type '['str']'. Received type: '%s'" % type(
url)
subdom_funcs = self.synchronous_command('Page.getResourceContent',
frameId=frameId, url=url)
return subdom_funcs | Function path: Page.getResourceContent
Domain: Page
Method name: getResourceContent
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'frameId' (type: FrameId) -> Frame id to get resource for.
'url' (type: string) -> URL of the resource to get content for.
Returns:
'content' (type: string) -> Resource content.
'base64Encoded' (type: boolean) -> True, if content was served as base64.
Description: Returns content of the given resource. | entailment |
def Page_searchInResource(self, frameId, url, query, **kwargs):
"""
Function path: Page.searchInResource
Domain: Page
Method name: searchInResource
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'frameId' (type: FrameId) -> Frame id for resource to search in.
'url' (type: string) -> URL of the resource to search in.
'query' (type: string) -> String to search for.
Optional arguments:
'caseSensitive' (type: boolean) -> If true, search is case sensitive.
'isRegex' (type: boolean) -> If true, treats string parameter as regex.
Returns:
'result' (type: array) -> List of search matches.
Description: Searches for given string in resource content.
"""
assert isinstance(url, (str,)
), "Argument 'url' must be of type '['str']'. Received type: '%s'" % type(
url)
assert isinstance(query, (str,)
), "Argument 'query' must be of type '['str']'. Received type: '%s'" % type(
query)
if 'caseSensitive' in kwargs:
assert isinstance(kwargs['caseSensitive'], (bool,)
), "Optional argument 'caseSensitive' must be of type '['bool']'. Received type: '%s'" % type(
kwargs['caseSensitive'])
if 'isRegex' in kwargs:
assert isinstance(kwargs['isRegex'], (bool,)
), "Optional argument 'isRegex' must be of type '['bool']'. Received type: '%s'" % type(
kwargs['isRegex'])
expected = ['caseSensitive', 'isRegex']
passed_keys = list(kwargs.keys())
assert all([(key in expected) for key in passed_keys]
), "Allowed kwargs are ['caseSensitive', 'isRegex']. Passed kwargs: %s" % passed_keys
subdom_funcs = self.synchronous_command('Page.searchInResource', frameId=
frameId, url=url, query=query, **kwargs)
return subdom_funcs | Function path: Page.searchInResource
Domain: Page
Method name: searchInResource
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'frameId' (type: FrameId) -> Frame id for resource to search in.
'url' (type: string) -> URL of the resource to search in.
'query' (type: string) -> String to search for.
Optional arguments:
'caseSensitive' (type: boolean) -> If true, search is case sensitive.
'isRegex' (type: boolean) -> If true, treats string parameter as regex.
Returns:
'result' (type: array) -> List of search matches.
Description: Searches for given string in resource content. | entailment |
def Page_setDocumentContent(self, frameId, html):
"""
Function path: Page.setDocumentContent
Domain: Page
Method name: setDocumentContent
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'frameId' (type: FrameId) -> Frame id to set HTML for.
'html' (type: string) -> HTML content to set.
No return value.
Description: Sets given markup as the document's HTML.
"""
assert isinstance(html, (str,)
), "Argument 'html' must be of type '['str']'. Received type: '%s'" % type(
html)
subdom_funcs = self.synchronous_command('Page.setDocumentContent',
frameId=frameId, html=html)
return subdom_funcs | Function path: Page.setDocumentContent
Domain: Page
Method name: setDocumentContent
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'frameId' (type: FrameId) -> Frame id to set HTML for.
'html' (type: string) -> HTML content to set.
No return value.
Description: Sets given markup as the document's HTML. | entailment |
def Page_setDeviceMetricsOverride(self, width, height, deviceScaleFactor,
mobile, **kwargs):
"""
Function path: Page.setDeviceMetricsOverride
Domain: Page
Method name: setDeviceMetricsOverride
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'width' (type: integer) -> Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override.
'height' (type: integer) -> Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override.
'deviceScaleFactor' (type: number) -> Overriding device scale factor value. 0 disables the override.
'mobile' (type: boolean) -> Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text autosizing and more.
Optional arguments:
'scale' (type: number) -> Scale to apply to resulting view image.
'screenWidth' (type: integer) -> Overriding screen width value in pixels (minimum 0, maximum 10000000).
'screenHeight' (type: integer) -> Overriding screen height value in pixels (minimum 0, maximum 10000000).
'positionX' (type: integer) -> Overriding view X position on screen in pixels (minimum 0, maximum 10000000).
'positionY' (type: integer) -> Overriding view Y position on screen in pixels (minimum 0, maximum 10000000).
'dontSetVisibleSize' (type: boolean) -> Do not set visible view size, rely upon explicit setVisibleSize call.
'screenOrientation' (type: Emulation.ScreenOrientation) -> Screen orientation override.
No return value.
Description: Overrides the values of device screen dimensions (window.screen.width, window.screen.height, window.innerWidth, window.innerHeight, and "device-width"/"device-height"-related CSS media query results).
"""
assert isinstance(width, (int,)
), "Argument 'width' must be of type '['int']'. Received type: '%s'" % type(
width)
assert isinstance(height, (int,)
), "Argument 'height' must be of type '['int']'. Received type: '%s'" % type(
height)
assert isinstance(deviceScaleFactor, (float, int)
), "Argument 'deviceScaleFactor' must be of type '['float', 'int']'. Received type: '%s'" % type(
deviceScaleFactor)
assert isinstance(mobile, (bool,)
), "Argument 'mobile' must be of type '['bool']'. Received type: '%s'" % type(
mobile)
if 'scale' in kwargs:
assert isinstance(kwargs['scale'], (float, int)
), "Optional argument 'scale' must be of type '['float', 'int']'. Received type: '%s'" % type(
kwargs['scale'])
if 'screenWidth' in kwargs:
assert isinstance(kwargs['screenWidth'], (int,)
), "Optional argument 'screenWidth' must be of type '['int']'. Received type: '%s'" % type(
kwargs['screenWidth'])
if 'screenHeight' in kwargs:
assert isinstance(kwargs['screenHeight'], (int,)
), "Optional argument 'screenHeight' must be of type '['int']'. Received type: '%s'" % type(
kwargs['screenHeight'])
if 'positionX' in kwargs:
assert isinstance(kwargs['positionX'], (int,)
), "Optional argument 'positionX' must be of type '['int']'. Received type: '%s'" % type(
kwargs['positionX'])
if 'positionY' in kwargs:
assert isinstance(kwargs['positionY'], (int,)
), "Optional argument 'positionY' must be of type '['int']'. Received type: '%s'" % type(
kwargs['positionY'])
if 'dontSetVisibleSize' in kwargs:
assert isinstance(kwargs['dontSetVisibleSize'], (bool,)
), "Optional argument 'dontSetVisibleSize' must be of type '['bool']'. Received type: '%s'" % type(
kwargs['dontSetVisibleSize'])
expected = ['scale', 'screenWidth', 'screenHeight', 'positionX',
'positionY', 'dontSetVisibleSize', 'screenOrientation']
passed_keys = list(kwargs.keys())
assert all([(key in expected) for key in passed_keys]
), "Allowed kwargs are ['scale', 'screenWidth', 'screenHeight', 'positionX', 'positionY', 'dontSetVisibleSize', 'screenOrientation']. Passed kwargs: %s" % passed_keys
subdom_funcs = self.synchronous_command('Page.setDeviceMetricsOverride',
width=width, height=height, deviceScaleFactor=deviceScaleFactor,
mobile=mobile, **kwargs)
return subdom_funcs | Function path: Page.setDeviceMetricsOverride
Domain: Page
Method name: setDeviceMetricsOverride
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'width' (type: integer) -> Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override.
'height' (type: integer) -> Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override.
'deviceScaleFactor' (type: number) -> Overriding device scale factor value. 0 disables the override.
'mobile' (type: boolean) -> Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text autosizing and more.
Optional arguments:
'scale' (type: number) -> Scale to apply to resulting view image.
'screenWidth' (type: integer) -> Overriding screen width value in pixels (minimum 0, maximum 10000000).
'screenHeight' (type: integer) -> Overriding screen height value in pixels (minimum 0, maximum 10000000).
'positionX' (type: integer) -> Overriding view X position on screen in pixels (minimum 0, maximum 10000000).
'positionY' (type: integer) -> Overriding view Y position on screen in pixels (minimum 0, maximum 10000000).
'dontSetVisibleSize' (type: boolean) -> Do not set visible view size, rely upon explicit setVisibleSize call.
'screenOrientation' (type: Emulation.ScreenOrientation) -> Screen orientation override.
No return value.
Description: Overrides the values of device screen dimensions (window.screen.width, window.screen.height, window.innerWidth, window.innerHeight, and "device-width"/"device-height"-related CSS media query results). | entailment |
def Page_setDeviceOrientationOverride(self, alpha, beta, gamma):
"""
Function path: Page.setDeviceOrientationOverride
Domain: Page
Method name: setDeviceOrientationOverride
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'alpha' (type: number) -> Mock alpha
'beta' (type: number) -> Mock beta
'gamma' (type: number) -> Mock gamma
No return value.
Description: Overrides the Device Orientation.
"""
assert isinstance(alpha, (float, int)
), "Argument 'alpha' must be of type '['float', 'int']'. Received type: '%s'" % type(
alpha)
assert isinstance(beta, (float, int)
), "Argument 'beta' must be of type '['float', 'int']'. Received type: '%s'" % type(
beta)
assert isinstance(gamma, (float, int)
), "Argument 'gamma' must be of type '['float', 'int']'. Received type: '%s'" % type(
gamma)
subdom_funcs = self.synchronous_command('Page.setDeviceOrientationOverride',
alpha=alpha, beta=beta, gamma=gamma)
return subdom_funcs | Function path: Page.setDeviceOrientationOverride
Domain: Page
Method name: setDeviceOrientationOverride
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'alpha' (type: number) -> Mock alpha
'beta' (type: number) -> Mock beta
'gamma' (type: number) -> Mock gamma
No return value.
Description: Overrides the Device Orientation. | entailment |
def Page_screencastFrameAck(self, sessionId):
"""
Function path: Page.screencastFrameAck
Domain: Page
Method name: screencastFrameAck
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'sessionId' (type: integer) -> Frame number.
No return value.
Description: Acknowledges that a screencast frame has been received by the frontend.
"""
assert isinstance(sessionId, (int,)
), "Argument 'sessionId' must be of type '['int']'. Received type: '%s'" % type(
sessionId)
subdom_funcs = self.synchronous_command('Page.screencastFrameAck',
sessionId=sessionId)
return subdom_funcs | Function path: Page.screencastFrameAck
Domain: Page
Method name: screencastFrameAck
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'sessionId' (type: integer) -> Frame number.
No return value.
Description: Acknowledges that a screencast frame has been received by the frontend. | entailment |
def Overlay_setShowPaintRects(self, result):
"""
Function path: Overlay.setShowPaintRects
Domain: Overlay
Method name: setShowPaintRects
Parameters:
Required arguments:
'result' (type: boolean) -> True for showing paint rectangles
No return value.
Description: Requests that backend shows paint rectangles
"""
assert isinstance(result, (bool,)
), "Argument 'result' must be of type '['bool']'. Received type: '%s'" % type(
result)
subdom_funcs = self.synchronous_command('Overlay.setShowPaintRects',
result=result)
return subdom_funcs | Function path: Overlay.setShowPaintRects
Domain: Overlay
Method name: setShowPaintRects
Parameters:
Required arguments:
'result' (type: boolean) -> True for showing paint rectangles
No return value.
Description: Requests that backend shows paint rectangles | entailment |
def Overlay_setShowDebugBorders(self, show):
"""
Function path: Overlay.setShowDebugBorders
Domain: Overlay
Method name: setShowDebugBorders
Parameters:
Required arguments:
'show' (type: boolean) -> True for showing debug borders
No return value.
Description: Requests that backend shows debug borders on layers
"""
assert isinstance(show, (bool,)
), "Argument 'show' must be of type '['bool']'. Received type: '%s'" % type(
show)
subdom_funcs = self.synchronous_command('Overlay.setShowDebugBorders',
show=show)
return subdom_funcs | Function path: Overlay.setShowDebugBorders
Domain: Overlay
Method name: setShowDebugBorders
Parameters:
Required arguments:
'show' (type: boolean) -> True for showing debug borders
No return value.
Description: Requests that backend shows debug borders on layers | entailment |
def Overlay_setShowFPSCounter(self, show):
"""
Function path: Overlay.setShowFPSCounter
Domain: Overlay
Method name: setShowFPSCounter
Parameters:
Required arguments:
'show' (type: boolean) -> True for showing the FPS counter
No return value.
Description: Requests that backend shows the FPS counter
"""
assert isinstance(show, (bool,)
), "Argument 'show' must be of type '['bool']'. Received type: '%s'" % type(
show)
subdom_funcs = self.synchronous_command('Overlay.setShowFPSCounter', show
=show)
return subdom_funcs | Function path: Overlay.setShowFPSCounter
Domain: Overlay
Method name: setShowFPSCounter
Parameters:
Required arguments:
'show' (type: boolean) -> True for showing the FPS counter
No return value.
Description: Requests that backend shows the FPS counter | entailment |
def Overlay_setShowScrollBottleneckRects(self, show):
"""
Function path: Overlay.setShowScrollBottleneckRects
Domain: Overlay
Method name: setShowScrollBottleneckRects
Parameters:
Required arguments:
'show' (type: boolean) -> True for showing scroll bottleneck rects
No return value.
Description: Requests that backend shows scroll bottleneck rects
"""
assert isinstance(show, (bool,)
), "Argument 'show' must be of type '['bool']'. Received type: '%s'" % type(
show)
subdom_funcs = self.synchronous_command(
'Overlay.setShowScrollBottleneckRects', show=show)
return subdom_funcs | Function path: Overlay.setShowScrollBottleneckRects
Domain: Overlay
Method name: setShowScrollBottleneckRects
Parameters:
Required arguments:
'show' (type: boolean) -> True for showing scroll bottleneck rects
No return value.
Description: Requests that backend shows scroll bottleneck rects | entailment |
def Overlay_setShowViewportSizeOnResize(self, show):
"""
Function path: Overlay.setShowViewportSizeOnResize
Domain: Overlay
Method name: setShowViewportSizeOnResize
Parameters:
Required arguments:
'show' (type: boolean) -> Whether to paint size or not.
No return value.
Description: Paints viewport size upon main frame resize.
"""
assert isinstance(show, (bool,)
), "Argument 'show' must be of type '['bool']'. Received type: '%s'" % type(
show)
subdom_funcs = self.synchronous_command('Overlay.setShowViewportSizeOnResize'
, show=show)
return subdom_funcs | Function path: Overlay.setShowViewportSizeOnResize
Domain: Overlay
Method name: setShowViewportSizeOnResize
Parameters:
Required arguments:
'show' (type: boolean) -> Whether to paint size or not.
No return value.
Description: Paints viewport size upon main frame resize. | entailment |
def Overlay_setSuspended(self, suspended):
"""
Function path: Overlay.setSuspended
Domain: Overlay
Method name: setSuspended
Parameters:
Required arguments:
'suspended' (type: boolean) -> Whether overlay should be suspended and not consume any resources until resumed.
No return value.
"""
assert isinstance(suspended, (bool,)
), "Argument 'suspended' must be of type '['bool']'. Received type: '%s'" % type(
suspended)
subdom_funcs = self.synchronous_command('Overlay.setSuspended', suspended
=suspended)
return subdom_funcs | Function path: Overlay.setSuspended
Domain: Overlay
Method name: setSuspended
Parameters:
Required arguments:
'suspended' (type: boolean) -> Whether overlay should be suspended and not consume any resources until resumed.
No return value. | entailment |
def Overlay_setInspectMode(self, mode, **kwargs):
"""
Function path: Overlay.setInspectMode
Domain: Overlay
Method name: setInspectMode
Parameters:
Required arguments:
'mode' (type: InspectMode) -> Set an inspection mode.
Optional arguments:
'highlightConfig' (type: HighlightConfig) -> A descriptor for the highlight appearance of hovered-over nodes. May be omitted if <code>enabled == false</code>.
No return value.
Description: Enters the 'inspect' mode. In this mode, elements that user is hovering over are highlighted. Backend then generates 'inspectNodeRequested' event upon element selection.
"""
expected = ['highlightConfig']
passed_keys = list(kwargs.keys())
assert all([(key in expected) for key in passed_keys]
), "Allowed kwargs are ['highlightConfig']. Passed kwargs: %s" % passed_keys
subdom_funcs = self.synchronous_command('Overlay.setInspectMode', mode=
mode, **kwargs)
return subdom_funcs | Function path: Overlay.setInspectMode
Domain: Overlay
Method name: setInspectMode
Parameters:
Required arguments:
'mode' (type: InspectMode) -> Set an inspection mode.
Optional arguments:
'highlightConfig' (type: HighlightConfig) -> A descriptor for the highlight appearance of hovered-over nodes. May be omitted if <code>enabled == false</code>.
No return value.
Description: Enters the 'inspect' mode. In this mode, elements that user is hovering over are highlighted. Backend then generates 'inspectNodeRequested' event upon element selection. | entailment |
def Overlay_highlightRect(self, x, y, width, height, **kwargs):
"""
Function path: Overlay.highlightRect
Domain: Overlay
Method name: highlightRect
Parameters:
Required arguments:
'x' (type: integer) -> X coordinate
'y' (type: integer) -> Y coordinate
'width' (type: integer) -> Rectangle width
'height' (type: integer) -> Rectangle height
Optional arguments:
'color' (type: DOM.RGBA) -> The highlight fill color (default: transparent).
'outlineColor' (type: DOM.RGBA) -> The highlight outline color (default: transparent).
No return value.
Description: Highlights given rectangle. Coordinates are absolute with respect to the main frame viewport.
"""
assert isinstance(x, (int,)
), "Argument 'x' must be of type '['int']'. Received type: '%s'" % type(x
)
assert isinstance(y, (int,)
), "Argument 'y' must be of type '['int']'. Received type: '%s'" % type(y
)
assert isinstance(width, (int,)
), "Argument 'width' must be of type '['int']'. Received type: '%s'" % type(
width)
assert isinstance(height, (int,)
), "Argument 'height' must be of type '['int']'. Received type: '%s'" % type(
height)
expected = ['color', 'outlineColor']
passed_keys = list(kwargs.keys())
assert all([(key in expected) for key in passed_keys]
), "Allowed kwargs are ['color', 'outlineColor']. Passed kwargs: %s" % passed_keys
subdom_funcs = self.synchronous_command('Overlay.highlightRect', x=x, y=y,
width=width, height=height, **kwargs)
return subdom_funcs | Function path: Overlay.highlightRect
Domain: Overlay
Method name: highlightRect
Parameters:
Required arguments:
'x' (type: integer) -> X coordinate
'y' (type: integer) -> Y coordinate
'width' (type: integer) -> Rectangle width
'height' (type: integer) -> Rectangle height
Optional arguments:
'color' (type: DOM.RGBA) -> The highlight fill color (default: transparent).
'outlineColor' (type: DOM.RGBA) -> The highlight outline color (default: transparent).
No return value.
Description: Highlights given rectangle. Coordinates are absolute with respect to the main frame viewport. | entailment |
def Overlay_highlightQuad(self, quad, **kwargs):
"""
Function path: Overlay.highlightQuad
Domain: Overlay
Method name: highlightQuad
Parameters:
Required arguments:
'quad' (type: DOM.Quad) -> Quad to highlight
Optional arguments:
'color' (type: DOM.RGBA) -> The highlight fill color (default: transparent).
'outlineColor' (type: DOM.RGBA) -> The highlight outline color (default: transparent).
No return value.
Description: Highlights given quad. Coordinates are absolute with respect to the main frame viewport.
"""
expected = ['color', 'outlineColor']
passed_keys = list(kwargs.keys())
assert all([(key in expected) for key in passed_keys]
), "Allowed kwargs are ['color', 'outlineColor']. Passed kwargs: %s" % passed_keys
subdom_funcs = self.synchronous_command('Overlay.highlightQuad', quad=
quad, **kwargs)
return subdom_funcs | Function path: Overlay.highlightQuad
Domain: Overlay
Method name: highlightQuad
Parameters:
Required arguments:
'quad' (type: DOM.Quad) -> Quad to highlight
Optional arguments:
'color' (type: DOM.RGBA) -> The highlight fill color (default: transparent).
'outlineColor' (type: DOM.RGBA) -> The highlight outline color (default: transparent).
No return value.
Description: Highlights given quad. Coordinates are absolute with respect to the main frame viewport. | entailment |
def Overlay_highlightNode(self, highlightConfig, **kwargs):
"""
Function path: Overlay.highlightNode
Domain: Overlay
Method name: highlightNode
Parameters:
Required arguments:
'highlightConfig' (type: HighlightConfig) -> A descriptor for the highlight appearance.
Optional arguments:
'nodeId' (type: DOM.NodeId) -> Identifier of the node to highlight.
'backendNodeId' (type: DOM.BackendNodeId) -> Identifier of the backend node to highlight.
'objectId' (type: Runtime.RemoteObjectId) -> JavaScript object id of the node to be highlighted.
No return value.
Description: Highlights DOM node with given id or with the given JavaScript object wrapper. Either nodeId or objectId must be specified.
"""
expected = ['nodeId', 'backendNodeId', 'objectId']
passed_keys = list(kwargs.keys())
assert all([(key in expected) for key in passed_keys]
), "Allowed kwargs are ['nodeId', 'backendNodeId', 'objectId']. Passed kwargs: %s" % passed_keys
subdom_funcs = self.synchronous_command('Overlay.highlightNode',
highlightConfig=highlightConfig, **kwargs)
return subdom_funcs | Function path: Overlay.highlightNode
Domain: Overlay
Method name: highlightNode
Parameters:
Required arguments:
'highlightConfig' (type: HighlightConfig) -> A descriptor for the highlight appearance.
Optional arguments:
'nodeId' (type: DOM.NodeId) -> Identifier of the node to highlight.
'backendNodeId' (type: DOM.BackendNodeId) -> Identifier of the backend node to highlight.
'objectId' (type: Runtime.RemoteObjectId) -> JavaScript object id of the node to be highlighted.
No return value.
Description: Highlights DOM node with given id or with the given JavaScript object wrapper. Either nodeId or objectId must be specified. | entailment |
def Overlay_highlightFrame(self, frameId, **kwargs):
"""
Function path: Overlay.highlightFrame
Domain: Overlay
Method name: highlightFrame
Parameters:
Required arguments:
'frameId' (type: Page.FrameId) -> Identifier of the frame to highlight.
Optional arguments:
'contentColor' (type: DOM.RGBA) -> The content box highlight fill color (default: transparent).
'contentOutlineColor' (type: DOM.RGBA) -> The content box highlight outline color (default: transparent).
No return value.
Description: Highlights owner element of the frame with given id.
"""
expected = ['contentColor', 'contentOutlineColor']
passed_keys = list(kwargs.keys())
assert all([(key in expected) for key in passed_keys]
), "Allowed kwargs are ['contentColor', 'contentOutlineColor']. Passed kwargs: %s" % passed_keys
subdom_funcs = self.synchronous_command('Overlay.highlightFrame', frameId
=frameId, **kwargs)
return subdom_funcs | Function path: Overlay.highlightFrame
Domain: Overlay
Method name: highlightFrame
Parameters:
Required arguments:
'frameId' (type: Page.FrameId) -> Identifier of the frame to highlight.
Optional arguments:
'contentColor' (type: DOM.RGBA) -> The content box highlight fill color (default: transparent).
'contentOutlineColor' (type: DOM.RGBA) -> The content box highlight outline color (default: transparent).
No return value.
Description: Highlights owner element of the frame with given id. | entailment |
def Emulation_setPageScaleFactor(self, pageScaleFactor):
"""
Function path: Emulation.setPageScaleFactor
Domain: Emulation
Method name: setPageScaleFactor
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'pageScaleFactor' (type: number) -> Page scale factor.
No return value.
Description: Sets a specified page scale factor.
"""
assert isinstance(pageScaleFactor, (float, int)
), "Argument 'pageScaleFactor' must be of type '['float', 'int']'. Received type: '%s'" % type(
pageScaleFactor)
subdom_funcs = self.synchronous_command('Emulation.setPageScaleFactor',
pageScaleFactor=pageScaleFactor)
return subdom_funcs | Function path: Emulation.setPageScaleFactor
Domain: Emulation
Method name: setPageScaleFactor
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'pageScaleFactor' (type: number) -> Page scale factor.
No return value.
Description: Sets a specified page scale factor. | entailment |
def Emulation_setVisibleSize(self, width, height):
"""
Function path: Emulation.setVisibleSize
Domain: Emulation
Method name: setVisibleSize
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'width' (type: integer) -> Frame width (DIP).
'height' (type: integer) -> Frame height (DIP).
No return value.
Description: Resizes the frame/viewport of the page. Note that this does not affect the frame's container (e.g. browser window). Can be used to produce screenshots of the specified size. Not supported on Android.
"""
assert isinstance(width, (int,)
), "Argument 'width' must be of type '['int']'. Received type: '%s'" % type(
width)
assert isinstance(height, (int,)
), "Argument 'height' must be of type '['int']'. Received type: '%s'" % type(
height)
subdom_funcs = self.synchronous_command('Emulation.setVisibleSize', width
=width, height=height)
return subdom_funcs | Function path: Emulation.setVisibleSize
Domain: Emulation
Method name: setVisibleSize
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'width' (type: integer) -> Frame width (DIP).
'height' (type: integer) -> Frame height (DIP).
No return value.
Description: Resizes the frame/viewport of the page. Note that this does not affect the frame's container (e.g. browser window). Can be used to produce screenshots of the specified size. Not supported on Android. | entailment |
def Emulation_setScriptExecutionDisabled(self, value):
"""
Function path: Emulation.setScriptExecutionDisabled
Domain: Emulation
Method name: setScriptExecutionDisabled
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'value' (type: boolean) -> Whether script execution should be disabled in the page.
No return value.
Description: Switches script execution in the page.
"""
assert isinstance(value, (bool,)
), "Argument 'value' must be of type '['bool']'. Received type: '%s'" % type(
value)
subdom_funcs = self.synchronous_command(
'Emulation.setScriptExecutionDisabled', value=value)
return subdom_funcs | Function path: Emulation.setScriptExecutionDisabled
Domain: Emulation
Method name: setScriptExecutionDisabled
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'value' (type: boolean) -> Whether script execution should be disabled in the page.
No return value.
Description: Switches script execution in the page. | entailment |
def Emulation_setEmulatedMedia(self, media):
"""
Function path: Emulation.setEmulatedMedia
Domain: Emulation
Method name: setEmulatedMedia
Parameters:
Required arguments:
'media' (type: string) -> Media type to emulate. Empty string disables the override.
No return value.
Description: Emulates the given media for CSS media queries.
"""
assert isinstance(media, (str,)
), "Argument 'media' must be of type '['str']'. Received type: '%s'" % type(
media)
subdom_funcs = self.synchronous_command('Emulation.setEmulatedMedia',
media=media)
return subdom_funcs | Function path: Emulation.setEmulatedMedia
Domain: Emulation
Method name: setEmulatedMedia
Parameters:
Required arguments:
'media' (type: string) -> Media type to emulate. Empty string disables the override.
No return value.
Description: Emulates the given media for CSS media queries. | entailment |
def Emulation_setCPUThrottlingRate(self, rate):
"""
Function path: Emulation.setCPUThrottlingRate
Domain: Emulation
Method name: setCPUThrottlingRate
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'rate' (type: number) -> Throttling rate as a slowdown factor (1 is no throttle, 2 is 2x slowdown, etc).
No return value.
Description: Enables CPU throttling to emulate slow CPUs.
"""
assert isinstance(rate, (float, int)
), "Argument 'rate' must be of type '['float', 'int']'. Received type: '%s'" % type(
rate)
subdom_funcs = self.synchronous_command('Emulation.setCPUThrottlingRate',
rate=rate)
return subdom_funcs | Function path: Emulation.setCPUThrottlingRate
Domain: Emulation
Method name: setCPUThrottlingRate
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'rate' (type: number) -> Throttling rate as a slowdown factor (1 is no throttle, 2 is 2x slowdown, etc).
No return value.
Description: Enables CPU throttling to emulate slow CPUs. | entailment |
def Emulation_setVirtualTimePolicy(self, policy, **kwargs):
"""
Function path: Emulation.setVirtualTimePolicy
Domain: Emulation
Method name: setVirtualTimePolicy
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'policy' (type: VirtualTimePolicy) -> No description
Optional arguments:
'budget' (type: integer) -> If set, after this many virtual milliseconds have elapsed virtual time will be paused and a virtualTimeBudgetExpired event is sent.
No return value.
Description: Turns on virtual time for all frames (replacing real-time with a synthetic time source) and sets the current virtual time policy. Note this supersedes any previous time budget.
"""
if 'budget' in kwargs:
assert isinstance(kwargs['budget'], (int,)
), "Optional argument 'budget' must be of type '['int']'. Received type: '%s'" % type(
kwargs['budget'])
expected = ['budget']
passed_keys = list(kwargs.keys())
assert all([(key in expected) for key in passed_keys]
), "Allowed kwargs are ['budget']. Passed kwargs: %s" % passed_keys
subdom_funcs = self.synchronous_command('Emulation.setVirtualTimePolicy',
policy=policy, **kwargs)
return subdom_funcs | Function path: Emulation.setVirtualTimePolicy
Domain: Emulation
Method name: setVirtualTimePolicy
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'policy' (type: VirtualTimePolicy) -> No description
Optional arguments:
'budget' (type: integer) -> If set, after this many virtual milliseconds have elapsed virtual time will be paused and a virtualTimeBudgetExpired event is sent.
No return value.
Description: Turns on virtual time for all frames (replacing real-time with a synthetic time source) and sets the current virtual time policy. Note this supersedes any previous time budget. | entailment |
def Emulation_setNavigatorOverrides(self, platform):
"""
Function path: Emulation.setNavigatorOverrides
Domain: Emulation
Method name: setNavigatorOverrides
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'platform' (type: string) -> The platform navigator.platform should return.
No return value.
Description: Overrides value returned by the javascript navigator object.
"""
assert isinstance(platform, (str,)
), "Argument 'platform' must be of type '['str']'. Received type: '%s'" % type(
platform)
subdom_funcs = self.synchronous_command('Emulation.setNavigatorOverrides',
platform=platform)
return subdom_funcs | Function path: Emulation.setNavigatorOverrides
Domain: Emulation
Method name: setNavigatorOverrides
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'platform' (type: string) -> The platform navigator.platform should return.
No return value.
Description: Overrides value returned by the javascript navigator object. | entailment |
def Emulation_setDefaultBackgroundColorOverride(self, **kwargs):
"""
Function path: Emulation.setDefaultBackgroundColorOverride
Domain: Emulation
Method name: setDefaultBackgroundColorOverride
WARNING: This function is marked 'Experimental'!
Parameters:
Optional arguments:
'color' (type: DOM.RGBA) -> RGBA of the default background color. If not specified, any existing override will be cleared.
No return value.
Description: Sets or clears an override of the default background color of the frame. This override is used if the content does not specify one.
"""
expected = ['color']
passed_keys = list(kwargs.keys())
assert all([(key in expected) for key in passed_keys]
), "Allowed kwargs are ['color']. Passed kwargs: %s" % passed_keys
subdom_funcs = self.synchronous_command(
'Emulation.setDefaultBackgroundColorOverride', **kwargs)
return subdom_funcs | Function path: Emulation.setDefaultBackgroundColorOverride
Domain: Emulation
Method name: setDefaultBackgroundColorOverride
WARNING: This function is marked 'Experimental'!
Parameters:
Optional arguments:
'color' (type: DOM.RGBA) -> RGBA of the default background color. If not specified, any existing override will be cleared.
No return value.
Description: Sets or clears an override of the default background color of the frame. This override is used if the content does not specify one. | entailment |
def Security_handleCertificateError(self, eventId, action):
"""
Function path: Security.handleCertificateError
Domain: Security
Method name: handleCertificateError
Parameters:
Required arguments:
'eventId' (type: integer) -> The ID of the event.
'action' (type: CertificateErrorAction) -> The action to take on the certificate error.
No return value.
Description: Handles a certificate error that fired a certificateError event.
"""
assert isinstance(eventId, (int,)
), "Argument 'eventId' must be of type '['int']'. Received type: '%s'" % type(
eventId)
subdom_funcs = self.synchronous_command('Security.handleCertificateError',
eventId=eventId, action=action)
return subdom_funcs | Function path: Security.handleCertificateError
Domain: Security
Method name: handleCertificateError
Parameters:
Required arguments:
'eventId' (type: integer) -> The ID of the event.
'action' (type: CertificateErrorAction) -> The action to take on the certificate error.
No return value.
Description: Handles a certificate error that fired a certificateError event. | entailment |
def Security_setOverrideCertificateErrors(self, override):
"""
Function path: Security.setOverrideCertificateErrors
Domain: Security
Method name: setOverrideCertificateErrors
Parameters:
Required arguments:
'override' (type: boolean) -> If true, certificate errors will be overridden.
No return value.
Description: Enable/disable overriding certificate errors. If enabled, all certificate error events need to be handled by the DevTools client and should be answered with handleCertificateError commands.
"""
assert isinstance(override, (bool,)
), "Argument 'override' must be of type '['bool']'. Received type: '%s'" % type(
override)
subdom_funcs = self.synchronous_command(
'Security.setOverrideCertificateErrors', override=override)
return subdom_funcs | Function path: Security.setOverrideCertificateErrors
Domain: Security
Method name: setOverrideCertificateErrors
Parameters:
Required arguments:
'override' (type: boolean) -> If true, certificate errors will be overridden.
No return value.
Description: Enable/disable overriding certificate errors. If enabled, all certificate error events need to be handled by the DevTools client and should be answered with handleCertificateError commands. | entailment |
def Audits_getEncodedResponse(self, requestId, encoding, **kwargs):
"""
Function path: Audits.getEncodedResponse
Domain: Audits
Method name: getEncodedResponse
Parameters:
Required arguments:
'requestId' (type: Network.RequestId) -> Identifier of the network request to get content for.
'encoding' (type: string) -> The encoding to use.
Optional arguments:
'quality' (type: number) -> The quality of the encoding (0-1). (defaults to 1)
'sizeOnly' (type: boolean) -> Whether to only return the size information (defaults to false).
Returns:
'body' (type: string) -> The encoded body as a base64 string. Omitted if sizeOnly is true.
'originalSize' (type: integer) -> Size before re-encoding.
'encodedSize' (type: integer) -> Size after re-encoding.
Description: Returns the response body and size if it were re-encoded with the specified settings. Only applies to images.
"""
assert isinstance(encoding, (str,)
), "Argument 'encoding' must be of type '['str']'. Received type: '%s'" % type(
encoding)
if 'quality' in kwargs:
assert isinstance(kwargs['quality'], (float, int)
), "Optional argument 'quality' must be of type '['float', 'int']'. Received type: '%s'" % type(
kwargs['quality'])
if 'sizeOnly' in kwargs:
assert isinstance(kwargs['sizeOnly'], (bool,)
), "Optional argument 'sizeOnly' must be of type '['bool']'. Received type: '%s'" % type(
kwargs['sizeOnly'])
expected = ['quality', 'sizeOnly']
passed_keys = list(kwargs.keys())
assert all([(key in expected) for key in passed_keys]
), "Allowed kwargs are ['quality', 'sizeOnly']. Passed kwargs: %s" % passed_keys
subdom_funcs = self.synchronous_command('Audits.getEncodedResponse',
requestId=requestId, encoding=encoding, **kwargs)
return subdom_funcs | Function path: Audits.getEncodedResponse
Domain: Audits
Method name: getEncodedResponse
Parameters:
Required arguments:
'requestId' (type: Network.RequestId) -> Identifier of the network request to get content for.
'encoding' (type: string) -> The encoding to use.
Optional arguments:
'quality' (type: number) -> The quality of the encoding (0-1). (defaults to 1)
'sizeOnly' (type: boolean) -> Whether to only return the size information (defaults to false).
Returns:
'body' (type: string) -> The encoded body as a base64 string. Omitted if sizeOnly is true.
'originalSize' (type: integer) -> Size before re-encoding.
'encodedSize' (type: integer) -> Size after re-encoding.
Description: Returns the response body and size if it were re-encoded with the specified settings. Only applies to images. | entailment |
def Network_setUserAgentOverride(self, userAgent):
"""
Function path: Network.setUserAgentOverride
Domain: Network
Method name: setUserAgentOverride
Parameters:
Required arguments:
'userAgent' (type: string) -> User agent to use.
No return value.
Description: Allows overriding user agent with the given string.
"""
assert isinstance(userAgent, (str,)
), "Argument 'userAgent' must be of type '['str']'. Received type: '%s'" % type(
userAgent)
subdom_funcs = self.synchronous_command('Network.setUserAgentOverride',
userAgent=userAgent)
return subdom_funcs | Function path: Network.setUserAgentOverride
Domain: Network
Method name: setUserAgentOverride
Parameters:
Required arguments:
'userAgent' (type: string) -> User agent to use.
No return value.
Description: Allows overriding user agent with the given string. | entailment |
def Network_setBlockedURLs(self, urls):
"""
Function path: Network.setBlockedURLs
Domain: Network
Method name: setBlockedURLs
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'urls' (type: array) -> URL patterns to block. Wildcards ('*') are allowed.
No return value.
Description: Blocks URLs from loading.
"""
assert isinstance(urls, (list, tuple)
), "Argument 'urls' must be of type '['list', 'tuple']'. Received type: '%s'" % type(
urls)
subdom_funcs = self.synchronous_command('Network.setBlockedURLs', urls=urls)
return subdom_funcs | Function path: Network.setBlockedURLs
Domain: Network
Method name: setBlockedURLs
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'urls' (type: array) -> URL patterns to block. Wildcards ('*') are allowed.
No return value.
Description: Blocks URLs from loading. | entailment |
def Network_getCookies(self, **kwargs):
"""
Function path: Network.getCookies
Domain: Network
Method name: getCookies
WARNING: This function is marked 'Experimental'!
Parameters:
Optional arguments:
'urls' (type: array) -> The list of URLs for which applicable cookies will be fetched
Returns:
'cookies' (type: array) -> Array of cookie objects.
Description: Returns all browser cookies for the current URL. Depending on the backend support, will return detailed cookie information in the <code>cookies</code> field.
"""
if 'urls' in kwargs:
assert isinstance(kwargs['urls'], (list, tuple)
), "Optional argument 'urls' must be of type '['list', 'tuple']'. Received type: '%s'" % type(
kwargs['urls'])
expected = ['urls']
passed_keys = list(kwargs.keys())
assert all([(key in expected) for key in passed_keys]
), "Allowed kwargs are ['urls']. Passed kwargs: %s" % passed_keys
subdom_funcs = self.synchronous_command('Network.getCookies', **kwargs)
return subdom_funcs | Function path: Network.getCookies
Domain: Network
Method name: getCookies
WARNING: This function is marked 'Experimental'!
Parameters:
Optional arguments:
'urls' (type: array) -> The list of URLs for which applicable cookies will be fetched
Returns:
'cookies' (type: array) -> Array of cookie objects.
Description: Returns all browser cookies for the current URL. Depending on the backend support, will return detailed cookie information in the <code>cookies</code> field. | entailment |
def Network_deleteCookies(self, name, **kwargs):
"""
Function path: Network.deleteCookies
Domain: Network
Method name: deleteCookies
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'name' (type: string) -> Name of the cookies to remove.
Optional arguments:
'url' (type: string) -> If specified, deletes all the cookies with the given name where domain and path match provided URL.
'domain' (type: string) -> If specified, deletes only cookies with the exact domain.
'path' (type: string) -> If specified, deletes only cookies with the exact path.
No return value.
Description: Deletes browser cookies with matching name and url or domain/path pair.
"""
assert isinstance(name, (str,)
), "Argument 'name' must be of type '['str']'. Received type: '%s'" % type(
name)
if 'url' in kwargs:
assert isinstance(kwargs['url'], (str,)
), "Optional argument 'url' must be of type '['str']'. Received type: '%s'" % type(
kwargs['url'])
if 'domain' in kwargs:
assert isinstance(kwargs['domain'], (str,)
), "Optional argument 'domain' must be of type '['str']'. Received type: '%s'" % type(
kwargs['domain'])
if 'path' in kwargs:
assert isinstance(kwargs['path'], (str,)
), "Optional argument 'path' must be of type '['str']'. Received type: '%s'" % type(
kwargs['path'])
expected = ['url', 'domain', 'path']
passed_keys = list(kwargs.keys())
assert all([(key in expected) for key in passed_keys]
), "Allowed kwargs are ['url', 'domain', 'path']. Passed kwargs: %s" % passed_keys
subdom_funcs = self.synchronous_command('Network.deleteCookies', name=
name, **kwargs)
return subdom_funcs | Function path: Network.deleteCookies
Domain: Network
Method name: deleteCookies
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'name' (type: string) -> Name of the cookies to remove.
Optional arguments:
'url' (type: string) -> If specified, deletes all the cookies with the given name where domain and path match provided URL.
'domain' (type: string) -> If specified, deletes only cookies with the exact domain.
'path' (type: string) -> If specified, deletes only cookies with the exact path.
No return value.
Description: Deletes browser cookies with matching name and url or domain/path pair. | entailment |
def Network_setCookie(self, name, value, **kwargs):
"""
Function path: Network.setCookie
Domain: Network
Method name: setCookie
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'name' (type: string) -> Cookie name.
'value' (type: string) -> Cookie value.
Optional arguments:
'url' (type: string) -> The request-URI to associate with the setting of the cookie. This value can affect the default domain and path values of the created cookie.
'domain' (type: string) -> Cookie domain.
'path' (type: string) -> Cookie path.
'secure' (type: boolean) -> True if cookie is secure.
'httpOnly' (type: boolean) -> True if cookie is http-only.
'sameSite' (type: CookieSameSite) -> Cookie SameSite type.
'expires' (type: TimeSinceEpoch) -> Cookie expiration date, session cookie if not set
Returns:
'success' (type: boolean) -> True if successfully set cookie.
Description: Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.
"""
assert isinstance(name, (str,)
), "Argument 'name' must be of type '['str']'. Received type: '%s'" % type(
name)
assert isinstance(value, (str,)
), "Argument 'value' must be of type '['str']'. Received type: '%s'" % type(
value)
if 'url' in kwargs:
assert isinstance(kwargs['url'], (str,)
), "Optional argument 'url' must be of type '['str']'. Received type: '%s'" % type(
kwargs['url'])
if 'domain' in kwargs:
assert isinstance(kwargs['domain'], (str,)
), "Optional argument 'domain' must be of type '['str']'. Received type: '%s'" % type(
kwargs['domain'])
if 'path' in kwargs:
assert isinstance(kwargs['path'], (str,)
), "Optional argument 'path' must be of type '['str']'. Received type: '%s'" % type(
kwargs['path'])
if 'secure' in kwargs:
assert isinstance(kwargs['secure'], (bool,)
), "Optional argument 'secure' must be of type '['bool']'. Received type: '%s'" % type(
kwargs['secure'])
if 'httpOnly' in kwargs:
assert isinstance(kwargs['httpOnly'], (bool,)
), "Optional argument 'httpOnly' must be of type '['bool']'. Received type: '%s'" % type(
kwargs['httpOnly'])
expected = ['url', 'domain', 'path', 'secure', 'httpOnly', 'sameSite',
'expires']
passed_keys = list(kwargs.keys())
assert all([(key in expected) for key in passed_keys]
), "Allowed kwargs are ['url', 'domain', 'path', 'secure', 'httpOnly', 'sameSite', 'expires']. Passed kwargs: %s" % passed_keys
subdom_funcs = self.synchronous_command('Network.setCookie', name=name,
value=value, **kwargs)
return subdom_funcs | Function path: Network.setCookie
Domain: Network
Method name: setCookie
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'name' (type: string) -> Cookie name.
'value' (type: string) -> Cookie value.
Optional arguments:
'url' (type: string) -> The request-URI to associate with the setting of the cookie. This value can affect the default domain and path values of the created cookie.
'domain' (type: string) -> Cookie domain.
'path' (type: string) -> Cookie path.
'secure' (type: boolean) -> True if cookie is secure.
'httpOnly' (type: boolean) -> True if cookie is http-only.
'sameSite' (type: CookieSameSite) -> Cookie SameSite type.
'expires' (type: TimeSinceEpoch) -> Cookie expiration date, session cookie if not set
Returns:
'success' (type: boolean) -> True if successfully set cookie.
Description: Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist. | entailment |
def Network_setCookies(self, cookies):
"""
Function path: Network.setCookies
Domain: Network
Method name: setCookies
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'cookies' (type: array) -> Cookies to be set.
No return value.
Description: Sets given cookies.
"""
assert isinstance(cookies, (list, tuple)
), "Argument 'cookies' must be of type '['list', 'tuple']'. Received type: '%s'" % type(
cookies)
subdom_funcs = self.synchronous_command('Network.setCookies', cookies=cookies
)
return subdom_funcs | Function path: Network.setCookies
Domain: Network
Method name: setCookies
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'cookies' (type: array) -> Cookies to be set.
No return value.
Description: Sets given cookies. | entailment |
def Network_emulateNetworkConditions(self, offline, latency,
downloadThroughput, uploadThroughput, **kwargs):
"""
Function path: Network.emulateNetworkConditions
Domain: Network
Method name: emulateNetworkConditions
Parameters:
Required arguments:
'offline' (type: boolean) -> True to emulate internet disconnection.
'latency' (type: number) -> Minimum latency from request sent to response headers received (ms).
'downloadThroughput' (type: number) -> Maximal aggregated download throughput (bytes/sec). -1 disables download throttling.
'uploadThroughput' (type: number) -> Maximal aggregated upload throughput (bytes/sec). -1 disables upload throttling.
Optional arguments:
'connectionType' (type: ConnectionType) -> Connection type if known.
No return value.
Description: Activates emulation of network conditions.
"""
assert isinstance(offline, (bool,)
), "Argument 'offline' must be of type '['bool']'. Received type: '%s'" % type(
offline)
assert isinstance(latency, (float, int)
), "Argument 'latency' must be of type '['float', 'int']'. Received type: '%s'" % type(
latency)
assert isinstance(downloadThroughput, (float, int)
), "Argument 'downloadThroughput' must be of type '['float', 'int']'. Received type: '%s'" % type(
downloadThroughput)
assert isinstance(uploadThroughput, (float, int)
), "Argument 'uploadThroughput' must be of type '['float', 'int']'. Received type: '%s'" % type(
uploadThroughput)
expected = ['connectionType']
passed_keys = list(kwargs.keys())
assert all([(key in expected) for key in passed_keys]
), "Allowed kwargs are ['connectionType']. Passed kwargs: %s" % passed_keys
subdom_funcs = self.synchronous_command('Network.emulateNetworkConditions',
offline=offline, latency=latency, downloadThroughput=
downloadThroughput, uploadThroughput=uploadThroughput, **kwargs)
return subdom_funcs | Function path: Network.emulateNetworkConditions
Domain: Network
Method name: emulateNetworkConditions
Parameters:
Required arguments:
'offline' (type: boolean) -> True to emulate internet disconnection.
'latency' (type: number) -> Minimum latency from request sent to response headers received (ms).
'downloadThroughput' (type: number) -> Maximal aggregated download throughput (bytes/sec). -1 disables download throttling.
'uploadThroughput' (type: number) -> Maximal aggregated upload throughput (bytes/sec). -1 disables upload throttling.
Optional arguments:
'connectionType' (type: ConnectionType) -> Connection type if known.
No return value.
Description: Activates emulation of network conditions. | entailment |
def Network_setCacheDisabled(self, cacheDisabled):
"""
Function path: Network.setCacheDisabled
Domain: Network
Method name: setCacheDisabled
Parameters:
Required arguments:
'cacheDisabled' (type: boolean) -> Cache disabled state.
No return value.
Description: Toggles ignoring cache for each request. If <code>true</code>, cache will not be used.
"""
assert isinstance(cacheDisabled, (bool,)
), "Argument 'cacheDisabled' must be of type '['bool']'. Received type: '%s'" % type(
cacheDisabled)
subdom_funcs = self.synchronous_command('Network.setCacheDisabled',
cacheDisabled=cacheDisabled)
return subdom_funcs | Function path: Network.setCacheDisabled
Domain: Network
Method name: setCacheDisabled
Parameters:
Required arguments:
'cacheDisabled' (type: boolean) -> Cache disabled state.
No return value.
Description: Toggles ignoring cache for each request. If <code>true</code>, cache will not be used. | entailment |
def Network_setBypassServiceWorker(self, bypass):
"""
Function path: Network.setBypassServiceWorker
Domain: Network
Method name: setBypassServiceWorker
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'bypass' (type: boolean) -> Bypass service worker and load from network.
No return value.
Description: Toggles ignoring of service worker for each request.
"""
assert isinstance(bypass, (bool,)
), "Argument 'bypass' must be of type '['bool']'. Received type: '%s'" % type(
bypass)
subdom_funcs = self.synchronous_command('Network.setBypassServiceWorker',
bypass=bypass)
return subdom_funcs | Function path: Network.setBypassServiceWorker
Domain: Network
Method name: setBypassServiceWorker
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'bypass' (type: boolean) -> Bypass service worker and load from network.
No return value.
Description: Toggles ignoring of service worker for each request. | entailment |
def Network_getCertificate(self, origin):
"""
Function path: Network.getCertificate
Domain: Network
Method name: getCertificate
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'origin' (type: string) -> Origin to get certificate for.
Returns:
'tableNames' (type: array) -> No description
Description: Returns the DER-encoded certificate.
"""
assert isinstance(origin, (str,)
), "Argument 'origin' must be of type '['str']'. Received type: '%s'" % type(
origin)
subdom_funcs = self.synchronous_command('Network.getCertificate', origin=
origin)
return subdom_funcs | Function path: Network.getCertificate
Domain: Network
Method name: getCertificate
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'origin' (type: string) -> Origin to get certificate for.
Returns:
'tableNames' (type: array) -> No description
Description: Returns the DER-encoded certificate. | entailment |
def Network_setRequestInterceptionEnabled(self, enabled, **kwargs):
"""
Function path: Network.setRequestInterceptionEnabled
Domain: Network
Method name: setRequestInterceptionEnabled
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'enabled' (type: boolean) -> Whether requests should be intercepted. If patterns is not set, matches all and resets any previously set patterns. Other parameters are ignored if false.
Optional arguments:
'patterns' (type: array) -> URLs matching any of these patterns will be forwarded and wait for the corresponding continueInterceptedRequest call. Wildcards ('*' -> zero or more, '?' -> exactly one) are allowed. Escape character is backslash. If omitted equivalent to ['*'] (intercept all).
No return value.
Description: Sets the requests to intercept that match a the provided patterns.
"""
assert isinstance(enabled, (bool,)
), "Argument 'enabled' must be of type '['bool']'. Received type: '%s'" % type(
enabled)
if 'patterns' in kwargs:
assert isinstance(kwargs['patterns'], (list, tuple)
), "Optional argument 'patterns' must be of type '['list', 'tuple']'. Received type: '%s'" % type(
kwargs['patterns'])
expected = ['patterns']
passed_keys = list(kwargs.keys())
assert all([(key in expected) for key in passed_keys]
), "Allowed kwargs are ['patterns']. Passed kwargs: %s" % passed_keys
subdom_funcs = self.synchronous_command(
'Network.setRequestInterceptionEnabled', enabled=enabled, **kwargs)
return subdom_funcs | Function path: Network.setRequestInterceptionEnabled
Domain: Network
Method name: setRequestInterceptionEnabled
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'enabled' (type: boolean) -> Whether requests should be intercepted. If patterns is not set, matches all and resets any previously set patterns. Other parameters are ignored if false.
Optional arguments:
'patterns' (type: array) -> URLs matching any of these patterns will be forwarded and wait for the corresponding continueInterceptedRequest call. Wildcards ('*' -> zero or more, '?' -> exactly one) are allowed. Escape character is backslash. If omitted equivalent to ['*'] (intercept all).
No return value.
Description: Sets the requests to intercept that match a the provided patterns. | entailment |
def Network_continueInterceptedRequest(self, interceptionId, **kwargs):
"""
Function path: Network.continueInterceptedRequest
Domain: Network
Method name: continueInterceptedRequest
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'interceptionId' (type: InterceptionId) -> No description
Optional arguments:
'errorReason' (type: ErrorReason) -> If set this causes the request to fail with the given reason. Passing <code>Aborted</code> for requests marked with <code>isNavigationRequest</code> also cancels the navigation. Must not be set in response to an authChallenge.
'rawResponse' (type: string) -> If set the requests completes using with the provided base64 encoded raw response, including HTTP status line and headers etc... Must not be set in response to an authChallenge.
'url' (type: string) -> If set the request url will be modified in a way that's not observable by page. Must not be set in response to an authChallenge.
'method' (type: string) -> If set this allows the request method to be overridden. Must not be set in response to an authChallenge.
'postData' (type: string) -> If set this allows postData to be set. Must not be set in response to an authChallenge.
'headers' (type: Headers) -> If set this allows the request headers to be changed. Must not be set in response to an authChallenge.
'authChallengeResponse' (type: AuthChallengeResponse) -> Response to a requestIntercepted with an authChallenge. Must not be set otherwise.
No return value.
Description: Response to Network.requestIntercepted which either modifies the request to continue with any modifications, or blocks it, or completes it with the provided response bytes. If a network fetch occurs as a result which encounters a redirect an additional Network.requestIntercepted event will be sent with the same InterceptionId.
"""
if 'rawResponse' in kwargs:
assert isinstance(kwargs['rawResponse'], (str,)
), "Optional argument 'rawResponse' must be of type '['str']'. Received type: '%s'" % type(
kwargs['rawResponse'])
if 'url' in kwargs:
assert isinstance(kwargs['url'], (str,)
), "Optional argument 'url' must be of type '['str']'. Received type: '%s'" % type(
kwargs['url'])
if 'method' in kwargs:
assert isinstance(kwargs['method'], (str,)
), "Optional argument 'method' must be of type '['str']'. Received type: '%s'" % type(
kwargs['method'])
if 'postData' in kwargs:
assert isinstance(kwargs['postData'], (str,)
), "Optional argument 'postData' must be of type '['str']'. Received type: '%s'" % type(
kwargs['postData'])
expected = ['errorReason', 'rawResponse', 'url', 'method', 'postData',
'headers', 'authChallengeResponse']
passed_keys = list(kwargs.keys())
assert all([(key in expected) for key in passed_keys]
), "Allowed kwargs are ['errorReason', 'rawResponse', 'url', 'method', 'postData', 'headers', 'authChallengeResponse']. Passed kwargs: %s" % passed_keys
subdom_funcs = self.synchronous_command('Network.continueInterceptedRequest',
interceptionId=interceptionId, **kwargs)
return subdom_funcs | Function path: Network.continueInterceptedRequest
Domain: Network
Method name: continueInterceptedRequest
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'interceptionId' (type: InterceptionId) -> No description
Optional arguments:
'errorReason' (type: ErrorReason) -> If set this causes the request to fail with the given reason. Passing <code>Aborted</code> for requests marked with <code>isNavigationRequest</code> also cancels the navigation. Must not be set in response to an authChallenge.
'rawResponse' (type: string) -> If set the requests completes using with the provided base64 encoded raw response, including HTTP status line and headers etc... Must not be set in response to an authChallenge.
'url' (type: string) -> If set the request url will be modified in a way that's not observable by page. Must not be set in response to an authChallenge.
'method' (type: string) -> If set this allows the request method to be overridden. Must not be set in response to an authChallenge.
'postData' (type: string) -> If set this allows postData to be set. Must not be set in response to an authChallenge.
'headers' (type: Headers) -> If set this allows the request headers to be changed. Must not be set in response to an authChallenge.
'authChallengeResponse' (type: AuthChallengeResponse) -> Response to a requestIntercepted with an authChallenge. Must not be set otherwise.
No return value.
Description: Response to Network.requestIntercepted which either modifies the request to continue with any modifications, or blocks it, or completes it with the provided response bytes. If a network fetch occurs as a result which encounters a redirect an additional Network.requestIntercepted event will be sent with the same InterceptionId. | entailment |
def Database_executeSQL(self, databaseId, query):
"""
Function path: Database.executeSQL
Domain: Database
Method name: executeSQL
Parameters:
Required arguments:
'databaseId' (type: DatabaseId) -> No description
'query' (type: string) -> No description
Returns:
'columnNames' (type: array) -> No description
'values' (type: array) -> No description
'sqlError' (type: Error) -> No description
"""
assert isinstance(query, (str,)
), "Argument 'query' must be of type '['str']'. Received type: '%s'" % type(
query)
subdom_funcs = self.synchronous_command('Database.executeSQL', databaseId
=databaseId, query=query)
return subdom_funcs | Function path: Database.executeSQL
Domain: Database
Method name: executeSQL
Parameters:
Required arguments:
'databaseId' (type: DatabaseId) -> No description
'query' (type: string) -> No description
Returns:
'columnNames' (type: array) -> No description
'values' (type: array) -> No description
'sqlError' (type: Error) -> No description | entailment |
def IndexedDB_requestDatabaseNames(self, securityOrigin):
"""
Function path: IndexedDB.requestDatabaseNames
Domain: IndexedDB
Method name: requestDatabaseNames
Parameters:
Required arguments:
'securityOrigin' (type: string) -> Security origin.
Returns:
'databaseNames' (type: array) -> Database names for origin.
Description: Requests database names for given security origin.
"""
assert isinstance(securityOrigin, (str,)
), "Argument 'securityOrigin' must be of type '['str']'. Received type: '%s'" % type(
securityOrigin)
subdom_funcs = self.synchronous_command('IndexedDB.requestDatabaseNames',
securityOrigin=securityOrigin)
return subdom_funcs | Function path: IndexedDB.requestDatabaseNames
Domain: IndexedDB
Method name: requestDatabaseNames
Parameters:
Required arguments:
'securityOrigin' (type: string) -> Security origin.
Returns:
'databaseNames' (type: array) -> Database names for origin.
Description: Requests database names for given security origin. | entailment |
def IndexedDB_requestData(self, securityOrigin, databaseName,
objectStoreName, indexName, skipCount, pageSize, **kwargs):
"""
Function path: IndexedDB.requestData
Domain: IndexedDB
Method name: requestData
Parameters:
Required arguments:
'securityOrigin' (type: string) -> Security origin.
'databaseName' (type: string) -> Database name.
'objectStoreName' (type: string) -> Object store name.
'indexName' (type: string) -> Index name, empty string for object store data requests.
'skipCount' (type: integer) -> Number of records to skip.
'pageSize' (type: integer) -> Number of records to fetch.
Optional arguments:
'keyRange' (type: KeyRange) -> Key range.
Returns:
'objectStoreDataEntries' (type: array) -> Array of object store data entries.
'hasMore' (type: boolean) -> If true, there are more entries to fetch in the given range.
Description: Requests data from object store or index.
"""
assert isinstance(securityOrigin, (str,)
), "Argument 'securityOrigin' must be of type '['str']'. Received type: '%s'" % type(
securityOrigin)
assert isinstance(databaseName, (str,)
), "Argument 'databaseName' must be of type '['str']'. Received type: '%s'" % type(
databaseName)
assert isinstance(objectStoreName, (str,)
), "Argument 'objectStoreName' must be of type '['str']'. Received type: '%s'" % type(
objectStoreName)
assert isinstance(indexName, (str,)
), "Argument 'indexName' must be of type '['str']'. Received type: '%s'" % type(
indexName)
assert isinstance(skipCount, (int,)
), "Argument 'skipCount' must be of type '['int']'. Received type: '%s'" % type(
skipCount)
assert isinstance(pageSize, (int,)
), "Argument 'pageSize' must be of type '['int']'. Received type: '%s'" % type(
pageSize)
expected = ['keyRange']
passed_keys = list(kwargs.keys())
assert all([(key in expected) for key in passed_keys]
), "Allowed kwargs are ['keyRange']. Passed kwargs: %s" % passed_keys
subdom_funcs = self.synchronous_command('IndexedDB.requestData',
securityOrigin=securityOrigin, databaseName=databaseName,
objectStoreName=objectStoreName, indexName=indexName, skipCount=
skipCount, pageSize=pageSize, **kwargs)
return subdom_funcs | Function path: IndexedDB.requestData
Domain: IndexedDB
Method name: requestData
Parameters:
Required arguments:
'securityOrigin' (type: string) -> Security origin.
'databaseName' (type: string) -> Database name.
'objectStoreName' (type: string) -> Object store name.
'indexName' (type: string) -> Index name, empty string for object store data requests.
'skipCount' (type: integer) -> Number of records to skip.
'pageSize' (type: integer) -> Number of records to fetch.
Optional arguments:
'keyRange' (type: KeyRange) -> Key range.
Returns:
'objectStoreDataEntries' (type: array) -> Array of object store data entries.
'hasMore' (type: boolean) -> If true, there are more entries to fetch in the given range.
Description: Requests data from object store or index. | entailment |
def IndexedDB_clearObjectStore(self, securityOrigin, databaseName,
objectStoreName):
"""
Function path: IndexedDB.clearObjectStore
Domain: IndexedDB
Method name: clearObjectStore
Parameters:
Required arguments:
'securityOrigin' (type: string) -> Security origin.
'databaseName' (type: string) -> Database name.
'objectStoreName' (type: string) -> Object store name.
Returns:
Description: Clears all entries from an object store.
"""
assert isinstance(securityOrigin, (str,)
), "Argument 'securityOrigin' must be of type '['str']'. Received type: '%s'" % type(
securityOrigin)
assert isinstance(databaseName, (str,)
), "Argument 'databaseName' must be of type '['str']'. Received type: '%s'" % type(
databaseName)
assert isinstance(objectStoreName, (str,)
), "Argument 'objectStoreName' must be of type '['str']'. Received type: '%s'" % type(
objectStoreName)
subdom_funcs = self.synchronous_command('IndexedDB.clearObjectStore',
securityOrigin=securityOrigin, databaseName=databaseName,
objectStoreName=objectStoreName)
return subdom_funcs | Function path: IndexedDB.clearObjectStore
Domain: IndexedDB
Method name: clearObjectStore
Parameters:
Required arguments:
'securityOrigin' (type: string) -> Security origin.
'databaseName' (type: string) -> Database name.
'objectStoreName' (type: string) -> Object store name.
Returns:
Description: Clears all entries from an object store. | entailment |
def IndexedDB_deleteDatabase(self, securityOrigin, databaseName):
"""
Function path: IndexedDB.deleteDatabase
Domain: IndexedDB
Method name: deleteDatabase
Parameters:
Required arguments:
'securityOrigin' (type: string) -> Security origin.
'databaseName' (type: string) -> Database name.
Returns:
Description: Deletes a database.
"""
assert isinstance(securityOrigin, (str,)
), "Argument 'securityOrigin' must be of type '['str']'. Received type: '%s'" % type(
securityOrigin)
assert isinstance(databaseName, (str,)
), "Argument 'databaseName' must be of type '['str']'. Received type: '%s'" % type(
databaseName)
subdom_funcs = self.synchronous_command('IndexedDB.deleteDatabase',
securityOrigin=securityOrigin, databaseName=databaseName)
return subdom_funcs | Function path: IndexedDB.deleteDatabase
Domain: IndexedDB
Method name: deleteDatabase
Parameters:
Required arguments:
'securityOrigin' (type: string) -> Security origin.
'databaseName' (type: string) -> Database name.
Returns:
Description: Deletes a database. | entailment |
def CacheStorage_requestCacheNames(self, securityOrigin):
"""
Function path: CacheStorage.requestCacheNames
Domain: CacheStorage
Method name: requestCacheNames
Parameters:
Required arguments:
'securityOrigin' (type: string) -> Security origin.
Returns:
'caches' (type: array) -> Caches for the security origin.
Description: Requests cache names.
"""
assert isinstance(securityOrigin, (str,)
), "Argument 'securityOrigin' must be of type '['str']'. Received type: '%s'" % type(
securityOrigin)
subdom_funcs = self.synchronous_command('CacheStorage.requestCacheNames',
securityOrigin=securityOrigin)
return subdom_funcs | Function path: CacheStorage.requestCacheNames
Domain: CacheStorage
Method name: requestCacheNames
Parameters:
Required arguments:
'securityOrigin' (type: string) -> Security origin.
Returns:
'caches' (type: array) -> Caches for the security origin.
Description: Requests cache names. | entailment |
def CacheStorage_requestEntries(self, cacheId, skipCount, pageSize):
"""
Function path: CacheStorage.requestEntries
Domain: CacheStorage
Method name: requestEntries
Parameters:
Required arguments:
'cacheId' (type: CacheId) -> ID of cache to get entries from.
'skipCount' (type: integer) -> Number of records to skip.
'pageSize' (type: integer) -> Number of records to fetch.
Returns:
'cacheDataEntries' (type: array) -> Array of object store data entries.
'hasMore' (type: boolean) -> If true, there are more entries to fetch in the given range.
Description: Requests data from cache.
"""
assert isinstance(skipCount, (int,)
), "Argument 'skipCount' must be of type '['int']'. Received type: '%s'" % type(
skipCount)
assert isinstance(pageSize, (int,)
), "Argument 'pageSize' must be of type '['int']'. Received type: '%s'" % type(
pageSize)
subdom_funcs = self.synchronous_command('CacheStorage.requestEntries',
cacheId=cacheId, skipCount=skipCount, pageSize=pageSize)
return subdom_funcs | Function path: CacheStorage.requestEntries
Domain: CacheStorage
Method name: requestEntries
Parameters:
Required arguments:
'cacheId' (type: CacheId) -> ID of cache to get entries from.
'skipCount' (type: integer) -> Number of records to skip.
'pageSize' (type: integer) -> Number of records to fetch.
Returns:
'cacheDataEntries' (type: array) -> Array of object store data entries.
'hasMore' (type: boolean) -> If true, there are more entries to fetch in the given range.
Description: Requests data from cache. | entailment |
def CacheStorage_deleteEntry(self, cacheId, request):
"""
Function path: CacheStorage.deleteEntry
Domain: CacheStorage
Method name: deleteEntry
Parameters:
Required arguments:
'cacheId' (type: CacheId) -> Id of cache where the entry will be deleted.
'request' (type: string) -> URL spec of the request.
No return value.
Description: Deletes a cache entry.
"""
assert isinstance(request, (str,)
), "Argument 'request' must be of type '['str']'. Received type: '%s'" % type(
request)
subdom_funcs = self.synchronous_command('CacheStorage.deleteEntry',
cacheId=cacheId, request=request)
return subdom_funcs | Function path: CacheStorage.deleteEntry
Domain: CacheStorage
Method name: deleteEntry
Parameters:
Required arguments:
'cacheId' (type: CacheId) -> Id of cache where the entry will be deleted.
'request' (type: string) -> URL spec of the request.
No return value.
Description: Deletes a cache entry. | entailment |
def CacheStorage_requestCachedResponse(self, cacheId, requestURL):
"""
Function path: CacheStorage.requestCachedResponse
Domain: CacheStorage
Method name: requestCachedResponse
Parameters:
Required arguments:
'cacheId' (type: CacheId) -> Id of cache that contains the enty.
'requestURL' (type: string) -> URL spec of the request.
Returns:
'response' (type: CachedResponse) -> Response read from the cache.
Description: Fetches cache entry.
"""
assert isinstance(requestURL, (str,)
), "Argument 'requestURL' must be of type '['str']'. Received type: '%s'" % type(
requestURL)
subdom_funcs = self.synchronous_command('CacheStorage.requestCachedResponse',
cacheId=cacheId, requestURL=requestURL)
return subdom_funcs | Function path: CacheStorage.requestCachedResponse
Domain: CacheStorage
Method name: requestCachedResponse
Parameters:
Required arguments:
'cacheId' (type: CacheId) -> Id of cache that contains the enty.
'requestURL' (type: string) -> URL spec of the request.
Returns:
'response' (type: CachedResponse) -> Response read from the cache.
Description: Fetches cache entry. | entailment |
def DOMStorage_setDOMStorageItem(self, storageId, key, value):
"""
Function path: DOMStorage.setDOMStorageItem
Domain: DOMStorage
Method name: setDOMStorageItem
Parameters:
Required arguments:
'storageId' (type: StorageId) -> No description
'key' (type: string) -> No description
'value' (type: string) -> No description
No return value.
"""
assert isinstance(key, (str,)
), "Argument 'key' must be of type '['str']'. Received type: '%s'" % type(
key)
assert isinstance(value, (str,)
), "Argument 'value' must be of type '['str']'. Received type: '%s'" % type(
value)
subdom_funcs = self.synchronous_command('DOMStorage.setDOMStorageItem',
storageId=storageId, key=key, value=value)
return subdom_funcs | Function path: DOMStorage.setDOMStorageItem
Domain: DOMStorage
Method name: setDOMStorageItem
Parameters:
Required arguments:
'storageId' (type: StorageId) -> No description
'key' (type: string) -> No description
'value' (type: string) -> No description
No return value. | entailment |
def DOMStorage_removeDOMStorageItem(self, storageId, key):
"""
Function path: DOMStorage.removeDOMStorageItem
Domain: DOMStorage
Method name: removeDOMStorageItem
Parameters:
Required arguments:
'storageId' (type: StorageId) -> No description
'key' (type: string) -> No description
No return value.
"""
assert isinstance(key, (str,)
), "Argument 'key' must be of type '['str']'. Received type: '%s'" % type(
key)
subdom_funcs = self.synchronous_command('DOMStorage.removeDOMStorageItem',
storageId=storageId, key=key)
return subdom_funcs | Function path: DOMStorage.removeDOMStorageItem
Domain: DOMStorage
Method name: removeDOMStorageItem
Parameters:
Required arguments:
'storageId' (type: StorageId) -> No description
'key' (type: string) -> No description
No return value. | entailment |
def DOM_querySelector(self, nodeId, selector):
"""
Function path: DOM.querySelector
Domain: DOM
Method name: querySelector
Parameters:
Required arguments:
'nodeId' (type: NodeId) -> Id of the node to query upon.
'selector' (type: string) -> Selector string.
Returns:
'nodeId' (type: NodeId) -> Query selector result.
Description: Executes <code>querySelector</code> on a given node.
"""
assert isinstance(selector, (str,)
), "Argument 'selector' must be of type '['str']'. Received type: '%s'" % type(
selector)
subdom_funcs = self.synchronous_command('DOM.querySelector', nodeId=
nodeId, selector=selector)
return subdom_funcs | Function path: DOM.querySelector
Domain: DOM
Method name: querySelector
Parameters:
Required arguments:
'nodeId' (type: NodeId) -> Id of the node to query upon.
'selector' (type: string) -> Selector string.
Returns:
'nodeId' (type: NodeId) -> Query selector result.
Description: Executes <code>querySelector</code> on a given node. | entailment |
def DOM_setNodeName(self, nodeId, name):
"""
Function path: DOM.setNodeName
Domain: DOM
Method name: setNodeName
Parameters:
Required arguments:
'nodeId' (type: NodeId) -> Id of the node to set name for.
'name' (type: string) -> New node's name.
Returns:
'nodeId' (type: NodeId) -> New node's id.
Description: Sets node name for a node with given id.
"""
assert isinstance(name, (str,)
), "Argument 'name' must be of type '['str']'. Received type: '%s'" % type(
name)
subdom_funcs = self.synchronous_command('DOM.setNodeName', nodeId=nodeId,
name=name)
return subdom_funcs | Function path: DOM.setNodeName
Domain: DOM
Method name: setNodeName
Parameters:
Required arguments:
'nodeId' (type: NodeId) -> Id of the node to set name for.
'name' (type: string) -> New node's name.
Returns:
'nodeId' (type: NodeId) -> New node's id.
Description: Sets node name for a node with given id. | entailment |
def DOM_setNodeValue(self, nodeId, value):
"""
Function path: DOM.setNodeValue
Domain: DOM
Method name: setNodeValue
Parameters:
Required arguments:
'nodeId' (type: NodeId) -> Id of the node to set value for.
'value' (type: string) -> New node's value.
No return value.
Description: Sets node value for a node with given id.
"""
assert isinstance(value, (str,)
), "Argument 'value' must be of type '['str']'. Received type: '%s'" % type(
value)
subdom_funcs = self.synchronous_command('DOM.setNodeValue', nodeId=nodeId,
value=value)
return subdom_funcs | Function path: DOM.setNodeValue
Domain: DOM
Method name: setNodeValue
Parameters:
Required arguments:
'nodeId' (type: NodeId) -> Id of the node to set value for.
'value' (type: string) -> New node's value.
No return value.
Description: Sets node value for a node with given id. | entailment |
def DOM_setAttributeValue(self, nodeId, name, value):
"""
Function path: DOM.setAttributeValue
Domain: DOM
Method name: setAttributeValue
Parameters:
Required arguments:
'nodeId' (type: NodeId) -> Id of the element to set attribute for.
'name' (type: string) -> Attribute name.
'value' (type: string) -> Attribute value.
No return value.
Description: Sets attribute for an element with given id.
"""
assert isinstance(name, (str,)
), "Argument 'name' must be of type '['str']'. Received type: '%s'" % type(
name)
assert isinstance(value, (str,)
), "Argument 'value' must be of type '['str']'. Received type: '%s'" % type(
value)
subdom_funcs = self.synchronous_command('DOM.setAttributeValue', nodeId=
nodeId, name=name, value=value)
return subdom_funcs | Function path: DOM.setAttributeValue
Domain: DOM
Method name: setAttributeValue
Parameters:
Required arguments:
'nodeId' (type: NodeId) -> Id of the element to set attribute for.
'name' (type: string) -> Attribute name.
'value' (type: string) -> Attribute value.
No return value.
Description: Sets attribute for an element with given id. | entailment |
def DOM_setAttributesAsText(self, nodeId, text, **kwargs):
"""
Function path: DOM.setAttributesAsText
Domain: DOM
Method name: setAttributesAsText
Parameters:
Required arguments:
'nodeId' (type: NodeId) -> Id of the element to set attributes for.
'text' (type: string) -> Text with a number of attributes. Will parse this text using HTML parser.
Optional arguments:
'name' (type: string) -> Attribute name to replace with new attributes derived from text in case text parsed successfully.
No return value.
Description: Sets attributes on element with given id. This method is useful when user edits some existing attribute value and types in several attribute name/value pairs.
"""
assert isinstance(text, (str,)
), "Argument 'text' must be of type '['str']'. Received type: '%s'" % type(
text)
if 'name' in kwargs:
assert isinstance(kwargs['name'], (str,)
), "Optional argument 'name' must be of type '['str']'. Received type: '%s'" % type(
kwargs['name'])
expected = ['name']
passed_keys = list(kwargs.keys())
assert all([(key in expected) for key in passed_keys]
), "Allowed kwargs are ['name']. Passed kwargs: %s" % passed_keys
subdom_funcs = self.synchronous_command('DOM.setAttributesAsText', nodeId
=nodeId, text=text, **kwargs)
return subdom_funcs | Function path: DOM.setAttributesAsText
Domain: DOM
Method name: setAttributesAsText
Parameters:
Required arguments:
'nodeId' (type: NodeId) -> Id of the element to set attributes for.
'text' (type: string) -> Text with a number of attributes. Will parse this text using HTML parser.
Optional arguments:
'name' (type: string) -> Attribute name to replace with new attributes derived from text in case text parsed successfully.
No return value.
Description: Sets attributes on element with given id. This method is useful when user edits some existing attribute value and types in several attribute name/value pairs. | entailment |
def DOM_setOuterHTML(self, nodeId, outerHTML):
"""
Function path: DOM.setOuterHTML
Domain: DOM
Method name: setOuterHTML
Parameters:
Required arguments:
'nodeId' (type: NodeId) -> Id of the node to set markup for.
'outerHTML' (type: string) -> Outer HTML markup to set.
No return value.
Description: Sets node HTML markup, returns new node id.
"""
assert isinstance(outerHTML, (str,)
), "Argument 'outerHTML' must be of type '['str']'. Received type: '%s'" % type(
outerHTML)
subdom_funcs = self.synchronous_command('DOM.setOuterHTML', nodeId=nodeId,
outerHTML=outerHTML)
return subdom_funcs | Function path: DOM.setOuterHTML
Domain: DOM
Method name: setOuterHTML
Parameters:
Required arguments:
'nodeId' (type: NodeId) -> Id of the node to set markup for.
'outerHTML' (type: string) -> Outer HTML markup to set.
No return value.
Description: Sets node HTML markup, returns new node id. | entailment |
def DOM_getSearchResults(self, searchId, fromIndex, toIndex):
"""
Function path: DOM.getSearchResults
Domain: DOM
Method name: getSearchResults
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'searchId' (type: string) -> Unique search session identifier.
'fromIndex' (type: integer) -> Start index of the search result to be returned.
'toIndex' (type: integer) -> End index of the search result to be returned.
Returns:
'nodeIds' (type: array) -> Ids of the search result nodes.
Description: Returns search results from given <code>fromIndex</code> to given <code>toIndex</code> from the sarch with the given identifier.
"""
assert isinstance(searchId, (str,)
), "Argument 'searchId' must be of type '['str']'. Received type: '%s'" % type(
searchId)
assert isinstance(fromIndex, (int,)
), "Argument 'fromIndex' must be of type '['int']'. Received type: '%s'" % type(
fromIndex)
assert isinstance(toIndex, (int,)
), "Argument 'toIndex' must be of type '['int']'. Received type: '%s'" % type(
toIndex)
subdom_funcs = self.synchronous_command('DOM.getSearchResults', searchId=
searchId, fromIndex=fromIndex, toIndex=toIndex)
return subdom_funcs | Function path: DOM.getSearchResults
Domain: DOM
Method name: getSearchResults
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'searchId' (type: string) -> Unique search session identifier.
'fromIndex' (type: integer) -> Start index of the search result to be returned.
'toIndex' (type: integer) -> End index of the search result to be returned.
Returns:
'nodeIds' (type: array) -> Ids of the search result nodes.
Description: Returns search results from given <code>fromIndex</code> to given <code>toIndex</code> from the sarch with the given identifier. | entailment |
def DOM_discardSearchResults(self, searchId):
"""
Function path: DOM.discardSearchResults
Domain: DOM
Method name: discardSearchResults
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'searchId' (type: string) -> Unique search session identifier.
No return value.
Description: Discards search results from the session with the given id. <code>getSearchResults</code> should no longer be called for that search.
"""
assert isinstance(searchId, (str,)
), "Argument 'searchId' must be of type '['str']'. Received type: '%s'" % type(
searchId)
subdom_funcs = self.synchronous_command('DOM.discardSearchResults',
searchId=searchId)
return subdom_funcs | Function path: DOM.discardSearchResults
Domain: DOM
Method name: discardSearchResults
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'searchId' (type: string) -> Unique search session identifier.
No return value.
Description: Discards search results from the session with the given id. <code>getSearchResults</code> should no longer be called for that search. | entailment |
def DOM_pushNodeByPathToFrontend(self, path):
"""
Function path: DOM.pushNodeByPathToFrontend
Domain: DOM
Method name: pushNodeByPathToFrontend
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'path' (type: string) -> Path to node in the proprietary format.
Returns:
'nodeId' (type: NodeId) -> Id of the node for given path.
Description: Requests that the node is sent to the caller given its path. // FIXME, use XPath
"""
assert isinstance(path, (str,)
), "Argument 'path' must be of type '['str']'. Received type: '%s'" % type(
path)
subdom_funcs = self.synchronous_command('DOM.pushNodeByPathToFrontend',
path=path)
return subdom_funcs | Function path: DOM.pushNodeByPathToFrontend
Domain: DOM
Method name: pushNodeByPathToFrontend
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'path' (type: string) -> Path to node in the proprietary format.
Returns:
'nodeId' (type: NodeId) -> Id of the node for given path.
Description: Requests that the node is sent to the caller given its path. // FIXME, use XPath | entailment |
def DOM_pushNodesByBackendIdsToFrontend(self, backendNodeIds):
"""
Function path: DOM.pushNodesByBackendIdsToFrontend
Domain: DOM
Method name: pushNodesByBackendIdsToFrontend
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'backendNodeIds' (type: array) -> The array of backend node ids.
Returns:
'nodeIds' (type: array) -> The array of ids of pushed nodes that correspond to the backend ids specified in backendNodeIds.
Description: Requests that a batch of nodes is sent to the caller given their backend node ids.
"""
assert isinstance(backendNodeIds, (list, tuple)
), "Argument 'backendNodeIds' must be of type '['list', 'tuple']'. Received type: '%s'" % type(
backendNodeIds)
subdom_funcs = self.synchronous_command('DOM.pushNodesByBackendIdsToFrontend'
, backendNodeIds=backendNodeIds)
return subdom_funcs | Function path: DOM.pushNodesByBackendIdsToFrontend
Domain: DOM
Method name: pushNodesByBackendIdsToFrontend
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'backendNodeIds' (type: array) -> The array of backend node ids.
Returns:
'nodeIds' (type: array) -> The array of ids of pushed nodes that correspond to the backend ids specified in backendNodeIds.
Description: Requests that a batch of nodes is sent to the caller given their backend node ids. | entailment |
def DOM_copyTo(self, nodeId, targetNodeId, **kwargs):
"""
Function path: DOM.copyTo
Domain: DOM
Method name: copyTo
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'nodeId' (type: NodeId) -> Id of the node to copy.
'targetNodeId' (type: NodeId) -> Id of the element to drop the copy into.
Optional arguments:
'insertBeforeNodeId' (type: NodeId) -> Drop the copy before this node (if absent, the copy becomes the last child of <code>targetNodeId</code>).
Returns:
'nodeId' (type: NodeId) -> Id of the node clone.
Description: Creates a deep copy of the specified node and places it into the target container before the given anchor.
"""
expected = ['insertBeforeNodeId']
passed_keys = list(kwargs.keys())
assert all([(key in expected) for key in passed_keys]
), "Allowed kwargs are ['insertBeforeNodeId']. Passed kwargs: %s" % passed_keys
subdom_funcs = self.synchronous_command('DOM.copyTo', nodeId=nodeId,
targetNodeId=targetNodeId, **kwargs)
return subdom_funcs | Function path: DOM.copyTo
Domain: DOM
Method name: copyTo
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'nodeId' (type: NodeId) -> Id of the node to copy.
'targetNodeId' (type: NodeId) -> Id of the element to drop the copy into.
Optional arguments:
'insertBeforeNodeId' (type: NodeId) -> Drop the copy before this node (if absent, the copy becomes the last child of <code>targetNodeId</code>).
Returns:
'nodeId' (type: NodeId) -> Id of the node clone.
Description: Creates a deep copy of the specified node and places it into the target container before the given anchor. | entailment |
def DOM_setFileInputFiles(self, files, **kwargs):
"""
Function path: DOM.setFileInputFiles
Domain: DOM
Method name: setFileInputFiles
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'files' (type: array) -> Array of file paths to set.
Optional arguments:
'nodeId' (type: NodeId) -> Identifier of the node.
'backendNodeId' (type: BackendNodeId) -> Identifier of the backend node.
'objectId' (type: Runtime.RemoteObjectId) -> JavaScript object id of the node wrapper.
No return value.
Description: Sets files for the given file input element.
"""
assert isinstance(files, (list, tuple)
), "Argument 'files' must be of type '['list', 'tuple']'. Received type: '%s'" % type(
files)
expected = ['nodeId', 'backendNodeId', 'objectId']
passed_keys = list(kwargs.keys())
assert all([(key in expected) for key in passed_keys]
), "Allowed kwargs are ['nodeId', 'backendNodeId', 'objectId']. Passed kwargs: %s" % passed_keys
subdom_funcs = self.synchronous_command('DOM.setFileInputFiles', files=
files, **kwargs)
return subdom_funcs | Function path: DOM.setFileInputFiles
Domain: DOM
Method name: setFileInputFiles
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'files' (type: array) -> Array of file paths to set.
Optional arguments:
'nodeId' (type: NodeId) -> Identifier of the node.
'backendNodeId' (type: BackendNodeId) -> Identifier of the backend node.
'objectId' (type: Runtime.RemoteObjectId) -> JavaScript object id of the node wrapper.
No return value.
Description: Sets files for the given file input element. | entailment |
def DOM_getNodeForLocation(self, x, y, **kwargs):
"""
Function path: DOM.getNodeForLocation
Domain: DOM
Method name: getNodeForLocation
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'x' (type: integer) -> X coordinate.
'y' (type: integer) -> Y coordinate.
Optional arguments:
'includeUserAgentShadowDOM' (type: boolean) -> False to skip to the nearest non-UA shadow root ancestor (default: false).
Returns:
'nodeId' (type: NodeId) -> Id of the node at given coordinates.
Description: Returns node id at given location.
"""
assert isinstance(x, (int,)
), "Argument 'x' must be of type '['int']'. Received type: '%s'" % type(x
)
assert isinstance(y, (int,)
), "Argument 'y' must be of type '['int']'. Received type: '%s'" % type(y
)
if 'includeUserAgentShadowDOM' in kwargs:
assert isinstance(kwargs['includeUserAgentShadowDOM'], (bool,)
), "Optional argument 'includeUserAgentShadowDOM' must be of type '['bool']'. Received type: '%s'" % type(
kwargs['includeUserAgentShadowDOM'])
expected = ['includeUserAgentShadowDOM']
passed_keys = list(kwargs.keys())
assert all([(key in expected) for key in passed_keys]
), "Allowed kwargs are ['includeUserAgentShadowDOM']. Passed kwargs: %s" % passed_keys
subdom_funcs = self.synchronous_command('DOM.getNodeForLocation', x=x, y=
y, **kwargs)
return subdom_funcs | Function path: DOM.getNodeForLocation
Domain: DOM
Method name: getNodeForLocation
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'x' (type: integer) -> X coordinate.
'y' (type: integer) -> Y coordinate.
Optional arguments:
'includeUserAgentShadowDOM' (type: boolean) -> False to skip to the nearest non-UA shadow root ancestor (default: false).
Returns:
'nodeId' (type: NodeId) -> Id of the node at given coordinates.
Description: Returns node id at given location. | entailment |
def DOM_describeNode(self, **kwargs):
"""
Function path: DOM.describeNode
Domain: DOM
Method name: describeNode
Parameters:
Optional arguments:
'nodeId' (type: NodeId) -> Identifier of the node.
'backendNodeId' (type: BackendNodeId) -> Identifier of the backend node.
'objectId' (type: Runtime.RemoteObjectId) -> JavaScript object id of the node wrapper.
'depth' (type: integer) -> The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0.
'pierce' (type: boolean) -> Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false).
Returns:
'node' (type: Node) -> Node description.
Description: Describes node given its id, does not require domain to be enabled. Does not start tracking any objects, can be used for automation.
"""
if 'depth' in kwargs:
assert isinstance(kwargs['depth'], (int,)
), "Optional argument 'depth' must be of type '['int']'. Received type: '%s'" % type(
kwargs['depth'])
if 'pierce' in kwargs:
assert isinstance(kwargs['pierce'], (bool,)
), "Optional argument 'pierce' must be of type '['bool']'. Received type: '%s'" % type(
kwargs['pierce'])
expected = ['nodeId', 'backendNodeId', 'objectId', 'depth', 'pierce']
passed_keys = list(kwargs.keys())
assert all([(key in expected) for key in passed_keys]
), "Allowed kwargs are ['nodeId', 'backendNodeId', 'objectId', 'depth', 'pierce']. Passed kwargs: %s" % passed_keys
subdom_funcs = self.synchronous_command('DOM.describeNode', **kwargs)
return subdom_funcs | Function path: DOM.describeNode
Domain: DOM
Method name: describeNode
Parameters:
Optional arguments:
'nodeId' (type: NodeId) -> Identifier of the node.
'backendNodeId' (type: BackendNodeId) -> Identifier of the backend node.
'objectId' (type: Runtime.RemoteObjectId) -> JavaScript object id of the node wrapper.
'depth' (type: integer) -> The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0.
'pierce' (type: boolean) -> Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false).
Returns:
'node' (type: Node) -> Node description.
Description: Describes node given its id, does not require domain to be enabled. Does not start tracking any objects, can be used for automation. | entailment |
def CSS_setStyleSheetText(self, styleSheetId, text):
"""
Function path: CSS.setStyleSheetText
Domain: CSS
Method name: setStyleSheetText
Parameters:
Required arguments:
'styleSheetId' (type: StyleSheetId) -> No description
'text' (type: string) -> No description
Returns:
'sourceMapURL' (type: string) -> URL of source map associated with script (if any).
Description: Sets the new stylesheet text.
"""
assert isinstance(text, (str,)
), "Argument 'text' must be of type '['str']'. Received type: '%s'" % type(
text)
subdom_funcs = self.synchronous_command('CSS.setStyleSheetText',
styleSheetId=styleSheetId, text=text)
return subdom_funcs | Function path: CSS.setStyleSheetText
Domain: CSS
Method name: setStyleSheetText
Parameters:
Required arguments:
'styleSheetId' (type: StyleSheetId) -> No description
'text' (type: string) -> No description
Returns:
'sourceMapURL' (type: string) -> URL of source map associated with script (if any).
Description: Sets the new stylesheet text. | entailment |
def CSS_setRuleSelector(self, styleSheetId, range, selector):
"""
Function path: CSS.setRuleSelector
Domain: CSS
Method name: setRuleSelector
Parameters:
Required arguments:
'styleSheetId' (type: StyleSheetId) -> No description
'range' (type: SourceRange) -> No description
'selector' (type: string) -> No description
Returns:
'selectorList' (type: SelectorList) -> The resulting selector list after modification.
Description: Modifies the rule selector.
"""
assert isinstance(selector, (str,)
), "Argument 'selector' must be of type '['str']'. Received type: '%s'" % type(
selector)
subdom_funcs = self.synchronous_command('CSS.setRuleSelector',
styleSheetId=styleSheetId, range=range, selector=selector)
return subdom_funcs | Function path: CSS.setRuleSelector
Domain: CSS
Method name: setRuleSelector
Parameters:
Required arguments:
'styleSheetId' (type: StyleSheetId) -> No description
'range' (type: SourceRange) -> No description
'selector' (type: string) -> No description
Returns:
'selectorList' (type: SelectorList) -> The resulting selector list after modification.
Description: Modifies the rule selector. | entailment |
def CSS_setKeyframeKey(self, styleSheetId, range, keyText):
"""
Function path: CSS.setKeyframeKey
Domain: CSS
Method name: setKeyframeKey
Parameters:
Required arguments:
'styleSheetId' (type: StyleSheetId) -> No description
'range' (type: SourceRange) -> No description
'keyText' (type: string) -> No description
Returns:
'keyText' (type: Value) -> The resulting key text after modification.
Description: Modifies the keyframe rule key text.
"""
assert isinstance(keyText, (str,)
), "Argument 'keyText' must be of type '['str']'. Received type: '%s'" % type(
keyText)
subdom_funcs = self.synchronous_command('CSS.setKeyframeKey',
styleSheetId=styleSheetId, range=range, keyText=keyText)
return subdom_funcs | Function path: CSS.setKeyframeKey
Domain: CSS
Method name: setKeyframeKey
Parameters:
Required arguments:
'styleSheetId' (type: StyleSheetId) -> No description
'range' (type: SourceRange) -> No description
'keyText' (type: string) -> No description
Returns:
'keyText' (type: Value) -> The resulting key text after modification.
Description: Modifies the keyframe rule key text. | entailment |
def CSS_setStyleTexts(self, edits):
"""
Function path: CSS.setStyleTexts
Domain: CSS
Method name: setStyleTexts
Parameters:
Required arguments:
'edits' (type: array) -> No description
Returns:
'styles' (type: array) -> The resulting styles after modification.
Description: Applies specified style edits one after another in the given order.
"""
assert isinstance(edits, (list, tuple)
), "Argument 'edits' must be of type '['list', 'tuple']'. Received type: '%s'" % type(
edits)
subdom_funcs = self.synchronous_command('CSS.setStyleTexts', edits=edits)
return subdom_funcs | Function path: CSS.setStyleTexts
Domain: CSS
Method name: setStyleTexts
Parameters:
Required arguments:
'edits' (type: array) -> No description
Returns:
'styles' (type: array) -> The resulting styles after modification.
Description: Applies specified style edits one after another in the given order. | entailment |
def CSS_setMediaText(self, styleSheetId, range, text):
"""
Function path: CSS.setMediaText
Domain: CSS
Method name: setMediaText
Parameters:
Required arguments:
'styleSheetId' (type: StyleSheetId) -> No description
'range' (type: SourceRange) -> No description
'text' (type: string) -> No description
Returns:
'media' (type: CSSMedia) -> The resulting CSS media rule after modification.
Description: Modifies the rule selector.
"""
assert isinstance(text, (str,)
), "Argument 'text' must be of type '['str']'. Received type: '%s'" % type(
text)
subdom_funcs = self.synchronous_command('CSS.setMediaText', styleSheetId=
styleSheetId, range=range, text=text)
return subdom_funcs | Function path: CSS.setMediaText
Domain: CSS
Method name: setMediaText
Parameters:
Required arguments:
'styleSheetId' (type: StyleSheetId) -> No description
'range' (type: SourceRange) -> No description
'text' (type: string) -> No description
Returns:
'media' (type: CSSMedia) -> The resulting CSS media rule after modification.
Description: Modifies the rule selector. | entailment |
def CSS_addRule(self, styleSheetId, ruleText, location):
"""
Function path: CSS.addRule
Domain: CSS
Method name: addRule
Parameters:
Required arguments:
'styleSheetId' (type: StyleSheetId) -> The css style sheet identifier where a new rule should be inserted.
'ruleText' (type: string) -> The text of a new rule.
'location' (type: SourceRange) -> Text position of a new rule in the target style sheet.
Returns:
'rule' (type: CSSRule) -> The newly created rule.
Description: Inserts a new rule with the given <code>ruleText</code> in a stylesheet with given <code>styleSheetId</code>, at the position specified by <code>location</code>.
"""
assert isinstance(ruleText, (str,)
), "Argument 'ruleText' must be of type '['str']'. Received type: '%s'" % type(
ruleText)
subdom_funcs = self.synchronous_command('CSS.addRule', styleSheetId=
styleSheetId, ruleText=ruleText, location=location)
return subdom_funcs | Function path: CSS.addRule
Domain: CSS
Method name: addRule
Parameters:
Required arguments:
'styleSheetId' (type: StyleSheetId) -> The css style sheet identifier where a new rule should be inserted.
'ruleText' (type: string) -> The text of a new rule.
'location' (type: SourceRange) -> Text position of a new rule in the target style sheet.
Returns:
'rule' (type: CSSRule) -> The newly created rule.
Description: Inserts a new rule with the given <code>ruleText</code> in a stylesheet with given <code>styleSheetId</code>, at the position specified by <code>location</code>. | entailment |
def CSS_forcePseudoState(self, nodeId, forcedPseudoClasses):
"""
Function path: CSS.forcePseudoState
Domain: CSS
Method name: forcePseudoState
Parameters:
Required arguments:
'nodeId' (type: DOM.NodeId) -> The element id for which to force the pseudo state.
'forcedPseudoClasses' (type: array) -> Element pseudo classes to force when computing the element's style.
No return value.
Description: Ensures that the given node will have specified pseudo-classes whenever its style is computed by the browser.
"""
assert isinstance(forcedPseudoClasses, (list, tuple)
), "Argument 'forcedPseudoClasses' must be of type '['list', 'tuple']'. Received type: '%s'" % type(
forcedPseudoClasses)
subdom_funcs = self.synchronous_command('CSS.forcePseudoState', nodeId=
nodeId, forcedPseudoClasses=forcedPseudoClasses)
return subdom_funcs | Function path: CSS.forcePseudoState
Domain: CSS
Method name: forcePseudoState
Parameters:
Required arguments:
'nodeId' (type: DOM.NodeId) -> The element id for which to force the pseudo state.
'forcedPseudoClasses' (type: array) -> Element pseudo classes to force when computing the element's style.
No return value.
Description: Ensures that the given node will have specified pseudo-classes whenever its style is computed by the browser. | entailment |
def CSS_setEffectivePropertyValueForNode(self, nodeId, propertyName, value):
"""
Function path: CSS.setEffectivePropertyValueForNode
Domain: CSS
Method name: setEffectivePropertyValueForNode
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'nodeId' (type: DOM.NodeId) -> The element id for which to set property.
'propertyName' (type: string) -> No description
'value' (type: string) -> No description
No return value.
Description: Find a rule with the given active property for the given node and set the new value for this property
"""
assert isinstance(propertyName, (str,)
), "Argument 'propertyName' must be of type '['str']'. Received type: '%s'" % type(
propertyName)
assert isinstance(value, (str,)
), "Argument 'value' must be of type '['str']'. Received type: '%s'" % type(
value)
subdom_funcs = self.synchronous_command(
'CSS.setEffectivePropertyValueForNode', nodeId=nodeId, propertyName=
propertyName, value=value)
return subdom_funcs | Function path: CSS.setEffectivePropertyValueForNode
Domain: CSS
Method name: setEffectivePropertyValueForNode
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'nodeId' (type: DOM.NodeId) -> The element id for which to set property.
'propertyName' (type: string) -> No description
'value' (type: string) -> No description
No return value.
Description: Find a rule with the given active property for the given node and set the new value for this property | entailment |
def DOMSnapshot_getSnapshot(self, computedStyleWhitelist):
"""
Function path: DOMSnapshot.getSnapshot
Domain: DOMSnapshot
Method name: getSnapshot
Parameters:
Required arguments:
'computedStyleWhitelist' (type: array) -> Whitelist of computed styles to return.
Returns:
'domNodes' (type: array) -> The nodes in the DOM tree. The DOMNode at index 0 corresponds to the root document.
'layoutTreeNodes' (type: array) -> The nodes in the layout tree.
'computedStyles' (type: array) -> Whitelisted ComputedStyle properties for each node in the layout tree.
Description: Returns a document snapshot, including the full DOM tree of the root node (including iframes, template contents, and imported documents) in a flattened array, as well as layout and white-listed computed style information for the nodes. Shadow DOM in the returned DOM tree is flattened.
"""
assert isinstance(computedStyleWhitelist, (list, tuple)
), "Argument 'computedStyleWhitelist' must be of type '['list', 'tuple']'. Received type: '%s'" % type(
computedStyleWhitelist)
subdom_funcs = self.synchronous_command('DOMSnapshot.getSnapshot',
computedStyleWhitelist=computedStyleWhitelist)
return subdom_funcs | Function path: DOMSnapshot.getSnapshot
Domain: DOMSnapshot
Method name: getSnapshot
Parameters:
Required arguments:
'computedStyleWhitelist' (type: array) -> Whitelist of computed styles to return.
Returns:
'domNodes' (type: array) -> The nodes in the DOM tree. The DOMNode at index 0 corresponds to the root document.
'layoutTreeNodes' (type: array) -> The nodes in the layout tree.
'computedStyles' (type: array) -> Whitelisted ComputedStyle properties for each node in the layout tree.
Description: Returns a document snapshot, including the full DOM tree of the root node (including iframes, template contents, and imported documents) in a flattened array, as well as layout and white-listed computed style information for the nodes. Shadow DOM in the returned DOM tree is flattened. | entailment |
def DOMDebugger_setDOMBreakpoint(self, nodeId, type):
"""
Function path: DOMDebugger.setDOMBreakpoint
Domain: DOMDebugger
Method name: setDOMBreakpoint
Parameters:
Required arguments:
'nodeId' (type: DOM.NodeId) -> Identifier of the node to set breakpoint on.
'type' (type: DOMBreakpointType) -> Type of the operation to stop upon.
No return value.
Description: Sets breakpoint on particular operation with DOM.
"""
subdom_funcs = self.synchronous_command('DOMDebugger.setDOMBreakpoint',
nodeId=nodeId, type=type)
return subdom_funcs | Function path: DOMDebugger.setDOMBreakpoint
Domain: DOMDebugger
Method name: setDOMBreakpoint
Parameters:
Required arguments:
'nodeId' (type: DOM.NodeId) -> Identifier of the node to set breakpoint on.
'type' (type: DOMBreakpointType) -> Type of the operation to stop upon.
No return value.
Description: Sets breakpoint on particular operation with DOM. | entailment |
def DOMDebugger_removeDOMBreakpoint(self, nodeId, type):
"""
Function path: DOMDebugger.removeDOMBreakpoint
Domain: DOMDebugger
Method name: removeDOMBreakpoint
Parameters:
Required arguments:
'nodeId' (type: DOM.NodeId) -> Identifier of the node to remove breakpoint from.
'type' (type: DOMBreakpointType) -> Type of the breakpoint to remove.
No return value.
Description: Removes DOM breakpoint that was set using <code>setDOMBreakpoint</code>.
"""
subdom_funcs = self.synchronous_command('DOMDebugger.removeDOMBreakpoint',
nodeId=nodeId, type=type)
return subdom_funcs | Function path: DOMDebugger.removeDOMBreakpoint
Domain: DOMDebugger
Method name: removeDOMBreakpoint
Parameters:
Required arguments:
'nodeId' (type: DOM.NodeId) -> Identifier of the node to remove breakpoint from.
'type' (type: DOMBreakpointType) -> Type of the breakpoint to remove.
No return value.
Description: Removes DOM breakpoint that was set using <code>setDOMBreakpoint</code>. | entailment |
def DOMDebugger_setInstrumentationBreakpoint(self, eventName):
"""
Function path: DOMDebugger.setInstrumentationBreakpoint
Domain: DOMDebugger
Method name: setInstrumentationBreakpoint
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'eventName' (type: string) -> Instrumentation name to stop on.
No return value.
Description: Sets breakpoint on particular native event.
"""
assert isinstance(eventName, (str,)
), "Argument 'eventName' must be of type '['str']'. Received type: '%s'" % type(
eventName)
subdom_funcs = self.synchronous_command(
'DOMDebugger.setInstrumentationBreakpoint', eventName=eventName)
return subdom_funcs | Function path: DOMDebugger.setInstrumentationBreakpoint
Domain: DOMDebugger
Method name: setInstrumentationBreakpoint
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'eventName' (type: string) -> Instrumentation name to stop on.
No return value.
Description: Sets breakpoint on particular native event. | entailment |
def DOMDebugger_removeInstrumentationBreakpoint(self, eventName):
"""
Function path: DOMDebugger.removeInstrumentationBreakpoint
Domain: DOMDebugger
Method name: removeInstrumentationBreakpoint
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'eventName' (type: string) -> Instrumentation name to stop on.
No return value.
Description: Removes breakpoint on particular native event.
"""
assert isinstance(eventName, (str,)
), "Argument 'eventName' must be of type '['str']'. Received type: '%s'" % type(
eventName)
subdom_funcs = self.synchronous_command(
'DOMDebugger.removeInstrumentationBreakpoint', eventName=eventName)
return subdom_funcs | Function path: DOMDebugger.removeInstrumentationBreakpoint
Domain: DOMDebugger
Method name: removeInstrumentationBreakpoint
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'eventName' (type: string) -> Instrumentation name to stop on.
No return value.
Description: Removes breakpoint on particular native event. | entailment |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.