|
- Method resolution order:
- Tab
- telemetry.core.web_contents.WebContents
- __builtin__.object
Methods defined here:
- Activate(self)
- Brings this tab to the foreground asynchronously.
Not all browsers or browser versions support this method.
Be sure to check browser.supports_tab_control.
Please note: this is asynchronous. There is a delay between this call
and the page's documentVisibilityState becoming 'visible', and yet more
delay until the actual tab is visible to the user. None of these delays
are included in this call.
- ClearCache(self, force)
- Clears the browser's networking related disk, memory and other caches.
Args:
force: Iff true, navigates to about:blank which destroys the previous
renderer, ensuring that even "live" resources in the memory cache are
cleared.
- ClearHighlight(self, color)
- Clears a highlight of the given bitmap.RgbaColor.
- CollectGarbage(self)
- GetCookieByName(self, name, timeout=60)
- Returns the value of the cookie by the given |name|.
- Highlight(self, color)
- Synchronously highlights entire tab contents with the given RgbaColor.
TODO(tonyg): It is possible that the z-index hack here might not work for
all pages. If this happens, DevTools also provides a method for this.
- Navigate(self, url, script_to_evaluate_on_commit=None, timeout=60)
- Navigates to url.
If |script_to_evaluate_on_commit| is given, the script source string will be
evaluated when the navigation is committed. This is after the context of
the page exists, but before any script on the page itself has executed.
- PerformActionAndWaitForNavigate(self, action_function, timeout=60)
- Executes action_function, and waits for the navigation to complete.
action_function must be a Python function that results in a navigation.
This function returns when the navigation is complete or when
the timeout has been exceeded.
- Screenshot(self, timeout=60)
- Capture a screenshot of the tab's contents.
Returns:
A telemetry.core.Bitmap.
- StartVideoCapture(self, min_bitrate_mbps)
- Starts capturing video of the tab's contents.
This works by flashing the entire tab contents to a arbitrary color and then
starting video recording. When the frames are processed, we can look for
that flash as the content bounds.
Args:
min_bitrate_mbps: The minimum caputre bitrate in MegaBits Per Second.
The platform is free to deliver a higher bitrate if it can do so
without increasing overhead.
- StopVideoCapture(self)
- Stops recording video of the tab's contents.
This looks for the initial color flash in the first frame to establish the
tab content boundaries and then omits all frames displaying the flash.
Yields:
(time_ms, bitmap) tuples representing each video keyframe. Only the first
frame in a run of sequential duplicate bitmaps is typically included.
time_ms is milliseconds since navigationStart.
bitmap is a telemetry.core.Bitmap.
- __init__(self, inspector_backend)
Data descriptors defined here:
- browser
- The browser in which this tab resides.
- dom_stats
- A dictionary populated with measured DOM statistics.
Currently this dictionary contains:
{
'document_count': integer,
'node_count': integer,
'event_listener_count': integer
}
- is_video_capture_running
- screenshot_supported
- True if the browser instance is capable of capturing screenshots.
- url
- video_capture_supported
- True if the browser instance is capable of capturing video.
Methods inherited from telemetry.core.web_contents.WebContents:
- Close(self)
- Closes this page.
Not all browsers or browser versions support this method.
Be sure to check browser.supports_tab_control.
- EvaluateJavaScript(self, expr, timeout=90)
- Evalutes expr in JavaScript and returns the JSONized result.
Consider using ExecuteJavaScript for cases where the result of the
expression is not needed.
If evaluation throws in JavaScript, a Python EvaluateException will
be raised.
If the result of the evaluation cannot be JSONized, then an
EvaluationException will be raised.
- EvaluateJavaScriptInContext(self, expr, context_id, timeout=90)
- Similar to ExecuteJavaScript, except context_id can refer to an iframe.
The main page has context_id=1, the first iframe context_id=2, etc.
- ExecuteJavaScript(self, expr, timeout=90)
- Executes expr in JavaScript. Does not return the result.
If the expression failed to evaluate, EvaluateException will be raised.
- ExecuteJavaScriptInContext(self, expr, context_id, timeout=90)
- Similar to ExecuteJavaScript, except context_id can refer to an iframe.
The main page has context_id=1, the first iframe context_id=2, etc.
- HasReachedQuiescence(self)
- Determine whether the page has reached quiescence after loading.
Returns:
True if 2 seconds have passed since last resource received, false
otherwise.
- StartTimelineRecording(self, options=None)
- StopTimelineRecording(self)
- TakeJSHeapSnapshot(self, timeout=120)
- WaitForDocumentReadyStateToBeComplete(self, timeout=90)
- WaitForDocumentReadyStateToBeInteractiveOrBetter(self, timeout=90)
- WaitForJavaScriptExpression(self, expr, timeout)
- Waits for the given JavaScript expression to be True.
This method is robust against any given Evaluation timing out.
Data descriptors inherited from telemetry.core.web_contents.WebContents:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
- is_timeline_recording_running
- message_output_stream
- timeline_model
|