blob: 2133051f16ada4d7a78590060b776689efea97db [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module telemetry.internal.browser.tab</title>
<meta charset="utf-8">
</head><body bgcolor="#f0f0f8">
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.internal.html"><font color="#ffffff">internal</font></a>.<a href="telemetry.internal.browser.html"><font color="#ffffff">browser</font></a>.tab</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/internal/browser/tab.py">telemetry/internal/browser/tab.py</a></font></td></tr></table>
<p><tt>#&nbsp;Copyright&nbsp;2012&nbsp;The&nbsp;Chromium&nbsp;Authors.&nbsp;All&nbsp;rights&nbsp;reserved.<br>
#&nbsp;Use&nbsp;of&nbsp;this&nbsp;source&nbsp;code&nbsp;is&nbsp;governed&nbsp;by&nbsp;a&nbsp;BSD-style&nbsp;license&nbsp;that&nbsp;can&nbsp;be<br>
#&nbsp;found&nbsp;in&nbsp;the&nbsp;LICENSE&nbsp;file.</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="telemetry.internal.image_processing.video.html">telemetry.internal.image_processing.video</a><br>
</td><td width="25%" valign=top><a href="telemetry.internal.browser.web_contents.html">telemetry.internal.browser.web_contents</a><br>
</td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="telemetry.internal.browser.web_contents.html#WebContents">telemetry.internal.browser.web_contents.WebContents</a>(<a href="__builtin__.html#object">__builtin__.object</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="telemetry.internal.browser.tab.html#Tab">Tab</a>
</font></dt></dl>
</dd>
</dl>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="Tab">class <strong>Tab</strong></a>(<a href="telemetry.internal.browser.web_contents.html#WebContents">telemetry.internal.browser.web_contents.WebContents</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>Represents&nbsp;a&nbsp;tab&nbsp;in&nbsp;the&nbsp;browser<br>
&nbsp;<br>
The&nbsp;important&nbsp;parts&nbsp;of&nbsp;the&nbsp;<a href="#Tab">Tab</a>&nbsp;object&nbsp;are&nbsp;in&nbsp;the&nbsp;runtime&nbsp;and&nbsp;page&nbsp;objects.<br>
E.g.:<br>
&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Navigates&nbsp;the&nbsp;tab&nbsp;to&nbsp;a&nbsp;given&nbsp;url.<br>
&nbsp;&nbsp;&nbsp;&nbsp;tab.<a href="#Tab-Navigate">Navigate</a>('<a href="http://www.google.com/">http://www.google.com/</a>')<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Evaluates&nbsp;1+1&nbsp;in&nbsp;the&nbsp;tab's&nbsp;JavaScript&nbsp;context.<br>
&nbsp;&nbsp;&nbsp;&nbsp;tab.Evaluate('1+1')<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="telemetry.internal.browser.tab.html#Tab">Tab</a></dd>
<dd><a href="telemetry.internal.browser.web_contents.html#WebContents">telemetry.internal.browser.web_contents.WebContents</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="Tab-Activate"><strong>Activate</strong></a>(self)</dt><dd><tt>Brings&nbsp;this&nbsp;tab&nbsp;to&nbsp;the&nbsp;foreground&nbsp;asynchronously.<br>
&nbsp;<br>
Not&nbsp;all&nbsp;browsers&nbsp;or&nbsp;browser&nbsp;versions&nbsp;support&nbsp;this&nbsp;method.<br>
Be&nbsp;sure&nbsp;to&nbsp;check&nbsp;browser.supports_tab_control.<br>
&nbsp;<br>
Please&nbsp;note:&nbsp;this&nbsp;is&nbsp;asynchronous.&nbsp;There&nbsp;is&nbsp;a&nbsp;delay&nbsp;between&nbsp;this&nbsp;call<br>
and&nbsp;the&nbsp;page's&nbsp;documentVisibilityState&nbsp;becoming&nbsp;'visible',&nbsp;and&nbsp;yet&nbsp;more<br>
delay&nbsp;until&nbsp;the&nbsp;actual&nbsp;tab&nbsp;is&nbsp;visible&nbsp;to&nbsp;the&nbsp;user.&nbsp;None&nbsp;of&nbsp;these&nbsp;delays<br>
are&nbsp;included&nbsp;in&nbsp;this&nbsp;call.<br>
&nbsp;<br>
Raises:<br>
&nbsp;&nbsp;devtools_http.DevToolsClientConnectionError<br>
&nbsp;&nbsp;devtools_client_backend.TabNotFoundError<br>
&nbsp;&nbsp;tab_list_backend.TabUnexpectedResponseException</tt></dd></dl>
<dl><dt><a name="Tab-ClearCache"><strong>ClearCache</strong></a>(self, force)</dt><dd><tt>Clears&nbsp;the&nbsp;browser's&nbsp;networking&nbsp;related&nbsp;disk,&nbsp;memory&nbsp;and&nbsp;other&nbsp;caches.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;force:&nbsp;Iff&nbsp;true,&nbsp;navigates&nbsp;to&nbsp;about:blank&nbsp;which&nbsp;destroys&nbsp;the&nbsp;previous<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;renderer,&nbsp;ensuring&nbsp;that&nbsp;even&nbsp;"live"&nbsp;resources&nbsp;in&nbsp;the&nbsp;memory&nbsp;cache&nbsp;are<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cleared.<br>
&nbsp;<br>
Raises:<br>
&nbsp;&nbsp;exceptions.EvaluateException<br>
&nbsp;&nbsp;exceptions.WebSocketDisconnected<br>
&nbsp;&nbsp;exceptions.TimeoutException<br>
&nbsp;&nbsp;exceptions.DevtoolsTargetCrashException<br>
&nbsp;&nbsp;errors.DeviceUnresponsiveError</tt></dd></dl>
<dl><dt><a name="Tab-ClearHighlight"><strong>ClearHighlight</strong></a>(self, color)</dt><dd><tt>Clears&nbsp;a&nbsp;highlight&nbsp;of&nbsp;the&nbsp;given&nbsp;bitmap.RgbaColor.<br>
&nbsp;<br>
Raises:<br>
&nbsp;&nbsp;exceptions.EvaluateException<br>
&nbsp;&nbsp;exceptions.WebSocketDisconnected<br>
&nbsp;&nbsp;exceptions.TimeoutException<br>
&nbsp;&nbsp;exceptions.DevtoolsTargetCrashException</tt></dd></dl>
<dl><dt><a name="Tab-Close"><strong>Close</strong></a>(self)</dt><dd><tt>Closes&nbsp;this&nbsp;tab.<br>
&nbsp;<br>
Not&nbsp;all&nbsp;browsers&nbsp;or&nbsp;browser&nbsp;versions&nbsp;support&nbsp;this&nbsp;method.<br>
Be&nbsp;sure&nbsp;to&nbsp;check&nbsp;browser.supports_tab_control.<br>
&nbsp;<br>
Raises:<br>
&nbsp;&nbsp;devtools_http.DevToolsClientConnectionError<br>
&nbsp;&nbsp;devtools_client_backend.TabNotFoundError<br>
&nbsp;&nbsp;tab_list_backend.TabUnexpectedResponseException<br>
&nbsp;&nbsp;exceptions.TimeoutException</tt></dd></dl>
<dl><dt><a name="Tab-CollectGarbage"><strong>CollectGarbage</strong></a>(self)</dt><dd><tt>Forces&nbsp;a&nbsp;garbage&nbsp;collection.<br>
&nbsp;<br>
Raises:<br>
&nbsp;&nbsp;exceptions.WebSocketDisconnected<br>
&nbsp;&nbsp;exceptions.TimeoutException<br>
&nbsp;&nbsp;exceptions.DevtoolsTargetCrashException</tt></dd></dl>
<dl><dt><a name="Tab-GetCookieByName"><strong>GetCookieByName</strong></a>(self, name, timeout<font color="#909090">=60</font>)</dt><dd><tt>Returns&nbsp;the&nbsp;value&nbsp;of&nbsp;the&nbsp;cookie&nbsp;by&nbsp;the&nbsp;given&nbsp;|name|.<br>
&nbsp;<br>
Raises:<br>
&nbsp;&nbsp;exceptions.WebSocketDisconnected<br>
&nbsp;&nbsp;exceptions.TimeoutException<br>
&nbsp;&nbsp;exceptions.DevtoolsTargetCrashException</tt></dd></dl>
<dl><dt><a name="Tab-Highlight"><strong>Highlight</strong></a>(self, color)</dt><dd><tt>Synchronously&nbsp;highlights&nbsp;entire&nbsp;tab&nbsp;contents&nbsp;with&nbsp;the&nbsp;given&nbsp;RgbaColor.<br>
&nbsp;<br>
TODO(tonyg):&nbsp;It&nbsp;is&nbsp;possible&nbsp;that&nbsp;the&nbsp;z-index&nbsp;hack&nbsp;here&nbsp;might&nbsp;not&nbsp;work&nbsp;for<br>
all&nbsp;pages.&nbsp;If&nbsp;this&nbsp;happens,&nbsp;DevTools&nbsp;also&nbsp;provides&nbsp;a&nbsp;method&nbsp;for&nbsp;this.<br>
&nbsp;<br>
Raises:<br>
&nbsp;&nbsp;exceptions.EvaluateException<br>
&nbsp;&nbsp;exceptions.WebSocketDisconnected<br>
&nbsp;&nbsp;exceptions.TimeoutException<br>
&nbsp;&nbsp;exceptions.DevtoolsTargetCrashException</tt></dd></dl>
<dl><dt><a name="Tab-Screenshot"><strong>Screenshot</strong></a>(self, timeout<font color="#909090">=60</font>)</dt><dd><tt>Capture&nbsp;a&nbsp;screenshot&nbsp;of&nbsp;the&nbsp;tab's&nbsp;contents.<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;A&nbsp;telemetry.core.Bitmap.<br>
Raises:<br>
&nbsp;&nbsp;exceptions.WebSocketDisconnected<br>
&nbsp;&nbsp;exceptions.TimeoutException<br>
&nbsp;&nbsp;exceptions.DevtoolsTargetCrashException</tt></dd></dl>
<dl><dt><a name="Tab-StartVideoCapture"><strong>StartVideoCapture</strong></a>(self, min_bitrate_mbps, highlight_bitmap<font color="#909090">=RgbaColor(r=222, g=100, b=13, a=255)</font>)</dt><dd><tt>Starts&nbsp;capturing&nbsp;video&nbsp;of&nbsp;the&nbsp;tab's&nbsp;contents.<br>
&nbsp;<br>
This&nbsp;works&nbsp;by&nbsp;flashing&nbsp;the&nbsp;entire&nbsp;tab&nbsp;contents&nbsp;to&nbsp;a&nbsp;arbitrary&nbsp;color&nbsp;and&nbsp;then<br>
starting&nbsp;video&nbsp;recording.&nbsp;When&nbsp;the&nbsp;frames&nbsp;are&nbsp;processed,&nbsp;we&nbsp;can&nbsp;look&nbsp;for<br>
that&nbsp;flash&nbsp;as&nbsp;the&nbsp;content&nbsp;bounds.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;min_bitrate_mbps:&nbsp;The&nbsp;minimum&nbsp;caputre&nbsp;bitrate&nbsp;in&nbsp;MegaBits&nbsp;Per&nbsp;Second.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;platform&nbsp;is&nbsp;free&nbsp;to&nbsp;deliver&nbsp;a&nbsp;higher&nbsp;bitrate&nbsp;if&nbsp;it&nbsp;can&nbsp;do&nbsp;so<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;without&nbsp;increasing&nbsp;overhead.<br>
&nbsp;<br>
Raises:<br>
&nbsp;&nbsp;exceptions.EvaluateException<br>
&nbsp;&nbsp;exceptions.WebSocketDisconnected<br>
&nbsp;&nbsp;exceptions.TimeoutException<br>
&nbsp;&nbsp;exceptions.DevtoolsTargetCrashException<br>
&nbsp;&nbsp;ValueError:&nbsp;If&nbsp;the&nbsp;required&nbsp;|min_bitrate_mbps|&nbsp;can't&nbsp;be&nbsp;achieved.</tt></dd></dl>
<dl><dt><a name="Tab-StopVideoCapture"><strong>StopVideoCapture</strong></a>(self)</dt><dd><tt>Stops&nbsp;recording&nbsp;video&nbsp;of&nbsp;the&nbsp;tab's&nbsp;contents.<br>
&nbsp;<br>
This&nbsp;looks&nbsp;for&nbsp;the&nbsp;initial&nbsp;color&nbsp;flash&nbsp;in&nbsp;the&nbsp;first&nbsp;frame&nbsp;to&nbsp;establish&nbsp;the<br>
tab&nbsp;content&nbsp;boundaries&nbsp;and&nbsp;then&nbsp;omits&nbsp;all&nbsp;frames&nbsp;displaying&nbsp;the&nbsp;flash.<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;video:&nbsp;A&nbsp;video&nbsp;object&nbsp;which&nbsp;is&nbsp;a&nbsp;telemetry.core.Video</tt></dd></dl>
<dl><dt><a name="Tab-__init__"><strong>__init__</strong></a>(self, inspector_backend, tab_list_backend, browser)</dt></dl>
<hr>
Data descriptors defined here:<br>
<dl><dt><strong>browser</strong></dt>
<dd><tt>The&nbsp;browser&nbsp;in&nbsp;which&nbsp;this&nbsp;tab&nbsp;resides.</tt></dd>
</dl>
<dl><dt><strong>dom_stats</strong></dt>
<dd><tt>A&nbsp;dictionary&nbsp;populated&nbsp;with&nbsp;measured&nbsp;DOM&nbsp;statistics.<br>
&nbsp;<br>
Currently&nbsp;this&nbsp;dictionary&nbsp;contains:<br>
{<br>
&nbsp;&nbsp;'document_count':&nbsp;integer,<br>
&nbsp;&nbsp;'node_count':&nbsp;integer,<br>
&nbsp;&nbsp;'event_listener_count':&nbsp;integer<br>
}<br>
&nbsp;<br>
Raises:<br>
&nbsp;&nbsp;inspector_memory.InspectorMemoryException<br>
&nbsp;&nbsp;exceptions.TimeoutException<br>
&nbsp;&nbsp;exceptions.DevtoolsTargetCrashException</tt></dd>
</dl>
<dl><dt><strong>is_video_capture_running</strong></dt>
</dl>
<dl><dt><strong>screenshot_supported</strong></dt>
<dd><tt>True&nbsp;if&nbsp;the&nbsp;browser&nbsp;instance&nbsp;is&nbsp;capable&nbsp;of&nbsp;capturing&nbsp;screenshots.</tt></dd>
</dl>
<dl><dt><strong>url</strong></dt>
<dd><tt>Returns&nbsp;the&nbsp;URL&nbsp;of&nbsp;the&nbsp;tab,&nbsp;as&nbsp;reported&nbsp;by&nbsp;devtools.<br>
&nbsp;<br>
Raises:<br>
&nbsp;&nbsp;devtools_http.DevToolsClientConnectionError</tt></dd>
</dl>
<dl><dt><strong>video_capture_supported</strong></dt>
<dd><tt>True&nbsp;if&nbsp;the&nbsp;browser&nbsp;instance&nbsp;is&nbsp;capable&nbsp;of&nbsp;capturing&nbsp;video.</tt></dd>
</dl>
<hr>
Methods inherited from <a href="telemetry.internal.browser.web_contents.html#WebContents">telemetry.internal.browser.web_contents.WebContents</a>:<br>
<dl><dt><a name="Tab-CloseConnections"><strong>CloseConnections</strong></a>(self)</dt><dd><tt>Closes&nbsp;all&nbsp;TCP&nbsp;sockets&nbsp;held&nbsp;open&nbsp;by&nbsp;the&nbsp;browser.<br>
&nbsp;<br>
Raises:<br>
&nbsp;&nbsp;exceptions.DevtoolsTargetCrashException&nbsp;if&nbsp;the&nbsp;tab&nbsp;is&nbsp;not&nbsp;alive.</tt></dd></dl>
<dl><dt><a name="Tab-EnableAllContexts"><strong>EnableAllContexts</strong></a>(self)</dt><dd><tt>Enable&nbsp;all&nbsp;contexts&nbsp;in&nbsp;a&nbsp;page.&nbsp;Returns&nbsp;the&nbsp;number&nbsp;of&nbsp;available&nbsp;contexts.<br>
&nbsp;<br>
Raises:<br>
&nbsp;&nbsp;exceptions.WebSocketDisconnected<br>
&nbsp;&nbsp;exceptions.TimeoutException<br>
&nbsp;&nbsp;exceptions.DevtoolsTargetCrashException</tt></dd></dl>
<dl><dt><a name="Tab-EvaluateJavaScript"><strong>EvaluateJavaScript</strong></a>(self, expr, timeout<font color="#909090">=90</font>)</dt><dd><tt>Evalutes&nbsp;expr&nbsp;in&nbsp;JavaScript&nbsp;and&nbsp;returns&nbsp;the&nbsp;JSONized&nbsp;result.<br>
&nbsp;<br>
Consider&nbsp;using&nbsp;ExecuteJavaScript&nbsp;for&nbsp;cases&nbsp;where&nbsp;the&nbsp;result&nbsp;of&nbsp;the<br>
expression&nbsp;is&nbsp;not&nbsp;needed.<br>
&nbsp;<br>
If&nbsp;evaluation&nbsp;throws&nbsp;in&nbsp;JavaScript,&nbsp;a&nbsp;Python&nbsp;EvaluateException&nbsp;will<br>
be&nbsp;raised.<br>
&nbsp;<br>
If&nbsp;the&nbsp;result&nbsp;of&nbsp;the&nbsp;evaluation&nbsp;cannot&nbsp;be&nbsp;JSONized,&nbsp;then&nbsp;an<br>
EvaluationException&nbsp;will&nbsp;be&nbsp;raised.<br>
&nbsp;<br>
Raises:<br>
&nbsp;&nbsp;exceptions.Error:&nbsp;See&nbsp;<a href="#Tab-EvaluateJavaScriptInContext">EvaluateJavaScriptInContext</a>()&nbsp;for&nbsp;a&nbsp;detailed&nbsp;list<br>
&nbsp;&nbsp;of&nbsp;possible&nbsp;exceptions.</tt></dd></dl>
<dl><dt><a name="Tab-EvaluateJavaScriptInContext"><strong>EvaluateJavaScriptInContext</strong></a>(self, expr, context_id, timeout<font color="#909090">=90</font>)</dt><dd><tt>Similar&nbsp;to&nbsp;ExecuteJavaScript,&nbsp;except&nbsp;context_id&nbsp;can&nbsp;refer&nbsp;to&nbsp;an&nbsp;iframe.<br>
The&nbsp;main&nbsp;page&nbsp;has&nbsp;context_id=1,&nbsp;the&nbsp;first&nbsp;iframe&nbsp;context_id=2,&nbsp;etc.<br>
&nbsp;<br>
Raises:<br>
&nbsp;&nbsp;exceptions.EvaluateException<br>
&nbsp;&nbsp;exceptions.WebSocketDisconnected<br>
&nbsp;&nbsp;exceptions.TimeoutException<br>
&nbsp;&nbsp;exceptions.DevtoolsTargetCrashException</tt></dd></dl>
<dl><dt><a name="Tab-ExecuteJavaScript"><strong>ExecuteJavaScript</strong></a>(self, statement, timeout<font color="#909090">=90</font>)</dt><dd><tt>Executes&nbsp;statement&nbsp;in&nbsp;JavaScript.&nbsp;Does&nbsp;not&nbsp;return&nbsp;the&nbsp;result.<br>
&nbsp;<br>
If&nbsp;the&nbsp;statement&nbsp;failed&nbsp;to&nbsp;evaluate,&nbsp;EvaluateException&nbsp;will&nbsp;be&nbsp;raised.<br>
&nbsp;<br>
Raises:<br>
&nbsp;&nbsp;exceptions.Error:&nbsp;See&nbsp;<a href="#Tab-ExecuteJavaScriptInContext">ExecuteJavaScriptInContext</a>()&nbsp;for&nbsp;a&nbsp;detailed&nbsp;list&nbsp;of<br>
&nbsp;&nbsp;possible&nbsp;exceptions.</tt></dd></dl>
<dl><dt><a name="Tab-ExecuteJavaScriptInContext"><strong>ExecuteJavaScriptInContext</strong></a>(self, expr, context_id, timeout<font color="#909090">=90</font>)</dt><dd><tt>Similar&nbsp;to&nbsp;ExecuteJavaScript,&nbsp;except&nbsp;context_id&nbsp;can&nbsp;refer&nbsp;to&nbsp;an&nbsp;iframe.<br>
The&nbsp;main&nbsp;page&nbsp;has&nbsp;context_id=1,&nbsp;the&nbsp;first&nbsp;iframe&nbsp;context_id=2,&nbsp;etc.<br>
&nbsp;<br>
Raises:<br>
&nbsp;&nbsp;exceptions.EvaluateException<br>
&nbsp;&nbsp;exceptions.WebSocketDisconnected<br>
&nbsp;&nbsp;exceptions.TimeoutException<br>
&nbsp;&nbsp;exceptions.DevtoolsTargetCrashException</tt></dd></dl>
<dl><dt><a name="Tab-GetUrl"><strong>GetUrl</strong></a>(self)</dt><dd><tt>Returns&nbsp;the&nbsp;URL&nbsp;to&nbsp;which&nbsp;the&nbsp;<a href="telemetry.internal.browser.web_contents.html#WebContents">WebContents</a>&nbsp;is&nbsp;connected.<br>
&nbsp;<br>
Raises:<br>
&nbsp;&nbsp;exceptions.Error:&nbsp;If&nbsp;there&nbsp;is&nbsp;an&nbsp;error&nbsp;in&nbsp;inspector&nbsp;backend&nbsp;connection.</tt></dd></dl>
<dl><dt><a name="Tab-GetWebviewContexts"><strong>GetWebviewContexts</strong></a>(self)</dt><dd><tt>Returns&nbsp;a&nbsp;list&nbsp;of&nbsp;webview&nbsp;contexts&nbsp;within&nbsp;the&nbsp;current&nbsp;inspector&nbsp;backend.<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;A&nbsp;list&nbsp;of&nbsp;<a href="telemetry.internal.browser.web_contents.html#WebContents">WebContents</a>&nbsp;objects&nbsp;representing&nbsp;the&nbsp;webview&nbsp;contexts.<br>
&nbsp;<br>
Raises:<br>
&nbsp;&nbsp;exceptions.Error:&nbsp;If&nbsp;there&nbsp;is&nbsp;an&nbsp;error&nbsp;in&nbsp;inspector&nbsp;backend&nbsp;connection.</tt></dd></dl>
<dl><dt><a name="Tab-HasReachedQuiescence"><strong>HasReachedQuiescence</strong></a>(self)</dt><dd><tt>Determine&nbsp;whether&nbsp;the&nbsp;page&nbsp;has&nbsp;reached&nbsp;quiescence&nbsp;after&nbsp;loading.<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;True&nbsp;if&nbsp;2&nbsp;seconds&nbsp;have&nbsp;passed&nbsp;since&nbsp;last&nbsp;resource&nbsp;received,&nbsp;false<br>
&nbsp;&nbsp;otherwise.<br>
Raises:<br>
&nbsp;&nbsp;exceptions.Error:&nbsp;See&nbsp;<a href="#Tab-EvaluateJavaScript">EvaluateJavaScript</a>()&nbsp;for&nbsp;a&nbsp;detailed&nbsp;list&nbsp;of<br>
&nbsp;&nbsp;possible&nbsp;exceptions.</tt></dd></dl>
<dl><dt><a name="Tab-IsAlive"><strong>IsAlive</strong></a>(self)</dt><dd><tt>Whether&nbsp;the&nbsp;<a href="telemetry.internal.browser.web_contents.html#WebContents">WebContents</a>&nbsp;is&nbsp;still&nbsp;operating&nbsp;normally.<br>
&nbsp;<br>
Since&nbsp;<a href="telemetry.internal.browser.web_contents.html#WebContents">WebContents</a>&nbsp;function&nbsp;asynchronously,&nbsp;this&nbsp;method&nbsp;does&nbsp;not&nbsp;guarantee<br>
that&nbsp;the&nbsp;<a href="telemetry.internal.browser.web_contents.html#WebContents">WebContents</a>&nbsp;will&nbsp;still&nbsp;be&nbsp;alive&nbsp;at&nbsp;any&nbsp;point&nbsp;in&nbsp;the&nbsp;future.<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;A&nbsp;boolean&nbsp;indicating&nbsp;whether&nbsp;the&nbsp;<a href="telemetry.internal.browser.web_contents.html#WebContents">WebContents</a>&nbsp;is&nbsp;opearting&nbsp;normally.</tt></dd></dl>
<dl><dt><a name="Tab-Navigate"><strong>Navigate</strong></a>(self, url, script_to_evaluate_on_commit<font color="#909090">=None</font>, timeout<font color="#909090">=90</font>)</dt><dd><tt>Navigates&nbsp;to&nbsp;url.<br>
&nbsp;<br>
If&nbsp;|script_to_evaluate_on_commit|&nbsp;is&nbsp;given,&nbsp;the&nbsp;script&nbsp;source&nbsp;string&nbsp;will&nbsp;be<br>
evaluated&nbsp;when&nbsp;the&nbsp;navigation&nbsp;is&nbsp;committed.&nbsp;This&nbsp;is&nbsp;after&nbsp;the&nbsp;context&nbsp;of<br>
the&nbsp;page&nbsp;exists,&nbsp;but&nbsp;before&nbsp;any&nbsp;script&nbsp;on&nbsp;the&nbsp;page&nbsp;itself&nbsp;has&nbsp;executed.<br>
&nbsp;<br>
Raises:<br>
&nbsp;&nbsp;exceptions.TimeoutException<br>
&nbsp;&nbsp;exceptions.DevtoolsTargetCrashException</tt></dd></dl>
<dl><dt><a name="Tab-StartTimelineRecording"><strong>StartTimelineRecording</strong></a>(self)</dt><dd><tt>Starts&nbsp;timeline&nbsp;recording.<br>
&nbsp;<br>
Raises:<br>
&nbsp;&nbsp;exceptions.TimeoutException<br>
&nbsp;&nbsp;exceptions.DevtoolsTargetCrashException</tt></dd></dl>
<dl><dt><a name="Tab-StopTimelineRecording"><strong>StopTimelineRecording</strong></a>(self)</dt><dd><tt>Stops&nbsp;timeline&nbsp;recording.<br>
&nbsp;<br>
Raises:<br>
&nbsp;&nbsp;exceptions.TimeoutException<br>
&nbsp;&nbsp;exceptions.DevtoolsTargetCrashException</tt></dd></dl>
<dl><dt><a name="Tab-SynthesizeScrollGesture"><strong>SynthesizeScrollGesture</strong></a>(self, x<font color="#909090">=100</font>, y<font color="#909090">=800</font>, xDistance<font color="#909090">=0</font>, yDistance<font color="#909090">=-500</font>, xOverscroll<font color="#909090">=None</font>, yOverscroll<font color="#909090">=None</font>, preventFling<font color="#909090">=True</font>, speed<font color="#909090">=None</font>, gestureSourceType<font color="#909090">=None</font>, repeatCount<font color="#909090">=None</font>, repeatDelayMs<font color="#909090">=None</font>, interactionMarkerName<font color="#909090">=None</font>)</dt><dd><tt>Runs&nbsp;an&nbsp;inspector&nbsp;command&nbsp;that&nbsp;causes&nbsp;a&nbsp;repeatable&nbsp;browser&nbsp;driven&nbsp;scroll.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;x:&nbsp;X&nbsp;coordinate&nbsp;of&nbsp;the&nbsp;start&nbsp;of&nbsp;the&nbsp;gesture&nbsp;in&nbsp;CSS&nbsp;pixels.<br>
&nbsp;&nbsp;y:&nbsp;Y&nbsp;coordinate&nbsp;of&nbsp;the&nbsp;start&nbsp;of&nbsp;the&nbsp;gesture&nbsp;in&nbsp;CSS&nbsp;pixels.<br>
&nbsp;&nbsp;xDistance:&nbsp;Distance&nbsp;to&nbsp;scroll&nbsp;along&nbsp;the&nbsp;X&nbsp;axis&nbsp;(positive&nbsp;to&nbsp;scroll&nbsp;left).<br>
&nbsp;&nbsp;yDistance:&nbsp;Ddistance&nbsp;to&nbsp;scroll&nbsp;along&nbsp;the&nbsp;Y&nbsp;axis&nbsp;(positive&nbsp;to&nbsp;scroll&nbsp;up).<br>
&nbsp;&nbsp;xOverscroll:&nbsp;Number&nbsp;of&nbsp;additional&nbsp;pixels&nbsp;to&nbsp;scroll&nbsp;back&nbsp;along&nbsp;the&nbsp;X&nbsp;axis.<br>
&nbsp;&nbsp;xOverscroll:&nbsp;Number&nbsp;of&nbsp;additional&nbsp;pixels&nbsp;to&nbsp;scroll&nbsp;back&nbsp;along&nbsp;the&nbsp;Y&nbsp;axis.<br>
&nbsp;&nbsp;preventFling:&nbsp;Prevents&nbsp;a&nbsp;fling&nbsp;gesture.<br>
&nbsp;&nbsp;speed:&nbsp;Swipe&nbsp;speed&nbsp;in&nbsp;pixels&nbsp;per&nbsp;second.<br>
&nbsp;&nbsp;gestureSourceType:&nbsp;Which&nbsp;type&nbsp;of&nbsp;input&nbsp;events&nbsp;to&nbsp;be&nbsp;generated.<br>
&nbsp;&nbsp;repeatCount:&nbsp;Number&nbsp;of&nbsp;additional&nbsp;repeats&nbsp;beyond&nbsp;the&nbsp;first&nbsp;scroll.<br>
&nbsp;&nbsp;repeatDelayMs:&nbsp;Number&nbsp;of&nbsp;milliseconds&nbsp;delay&nbsp;between&nbsp;each&nbsp;repeat.<br>
&nbsp;&nbsp;interactionMarkerName:&nbsp;The&nbsp;name&nbsp;of&nbsp;the&nbsp;interaction&nbsp;markers&nbsp;to&nbsp;generate.<br>
&nbsp;<br>
Raises:<br>
&nbsp;&nbsp;exceptions.TimeoutException<br>
&nbsp;&nbsp;exceptions.DevtoolsTargetCrashException</tt></dd></dl>
<dl><dt><a name="Tab-WaitForDocumentReadyStateToBeComplete"><strong>WaitForDocumentReadyStateToBeComplete</strong></a>(self, timeout<font color="#909090">=90</font>)</dt><dd><tt>Waits&nbsp;for&nbsp;the&nbsp;document&nbsp;to&nbsp;finish&nbsp;loading.<br>
&nbsp;<br>
Raises:<br>
&nbsp;&nbsp;exceptions.Error:&nbsp;See&nbsp;<a href="#Tab-WaitForJavaScriptExpression">WaitForJavaScriptExpression</a>()&nbsp;for&nbsp;a&nbsp;detailed&nbsp;list<br>
&nbsp;&nbsp;of&nbsp;possible&nbsp;exceptions.</tt></dd></dl>
<dl><dt><a name="Tab-WaitForDocumentReadyStateToBeInteractiveOrBetter"><strong>WaitForDocumentReadyStateToBeInteractiveOrBetter</strong></a>(self, timeout<font color="#909090">=90</font>)</dt><dd><tt>Waits&nbsp;for&nbsp;the&nbsp;document&nbsp;to&nbsp;be&nbsp;interactive.<br>
&nbsp;<br>
Raises:<br>
&nbsp;&nbsp;exceptions.Error:&nbsp;See&nbsp;<a href="#Tab-WaitForJavaScriptExpression">WaitForJavaScriptExpression</a>()&nbsp;for&nbsp;a&nbsp;detailed&nbsp;list<br>
&nbsp;&nbsp;of&nbsp;possible&nbsp;exceptions.</tt></dd></dl>
<dl><dt><a name="Tab-WaitForJavaScriptExpression"><strong>WaitForJavaScriptExpression</strong></a>(self, expr, timeout, dump_page_state_on_timeout<font color="#909090">=True</font>)</dt><dd><tt>Waits&nbsp;for&nbsp;the&nbsp;given&nbsp;JavaScript&nbsp;expression&nbsp;to&nbsp;be&nbsp;True.<br>
&nbsp;<br>
This&nbsp;method&nbsp;is&nbsp;robust&nbsp;against&nbsp;any&nbsp;given&nbsp;Evaluation&nbsp;timing&nbsp;out.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;expr:&nbsp;The&nbsp;expression&nbsp;to&nbsp;evaluate.<br>
&nbsp;&nbsp;timeout:&nbsp;The&nbsp;number&nbsp;of&nbsp;seconds&nbsp;to&nbsp;wait&nbsp;for&nbsp;the&nbsp;expression&nbsp;to&nbsp;be&nbsp;True.<br>
&nbsp;&nbsp;dump_page_state_on_timeout:&nbsp;Whether&nbsp;to&nbsp;provide&nbsp;additional&nbsp;information&nbsp;on<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;page&nbsp;state&nbsp;if&nbsp;a&nbsp;TimeoutException&nbsp;is&nbsp;thrown.<br>
&nbsp;<br>
Raises:<br>
&nbsp;&nbsp;exceptions.TimeoutException:&nbsp;On&nbsp;a&nbsp;timeout.<br>
&nbsp;&nbsp;exceptions.Error:&nbsp;See&nbsp;<a href="#Tab-EvaluateJavaScript">EvaluateJavaScript</a>()&nbsp;for&nbsp;a&nbsp;detailed&nbsp;list&nbsp;of<br>
&nbsp;&nbsp;possible&nbsp;exceptions.</tt></dd></dl>
<dl><dt><a name="Tab-WaitForNavigate"><strong>WaitForNavigate</strong></a>(self, timeout<font color="#909090">=90</font>)</dt><dd><tt>Waits&nbsp;for&nbsp;the&nbsp;navigation&nbsp;to&nbsp;complete.<br>
&nbsp;<br>
The&nbsp;current&nbsp;page&nbsp;is&nbsp;expect&nbsp;to&nbsp;be&nbsp;in&nbsp;a&nbsp;navigation.<br>
This&nbsp;function&nbsp;returns&nbsp;when&nbsp;the&nbsp;navigation&nbsp;is&nbsp;complete&nbsp;or&nbsp;when<br>
the&nbsp;timeout&nbsp;has&nbsp;been&nbsp;exceeded.<br>
&nbsp;<br>
Raises:<br>
&nbsp;&nbsp;exceptions.TimeoutException<br>
&nbsp;&nbsp;exceptions.DevtoolsTargetCrashException</tt></dd></dl>
<hr>
Data descriptors inherited from <a href="telemetry.internal.browser.web_contents.html#WebContents">telemetry.internal.browser.web_contents.WebContents</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>id</strong></dt>
<dd><tt>Return&nbsp;the&nbsp;unique&nbsp;id&nbsp;string&nbsp;for&nbsp;this&nbsp;tab&nbsp;object.</tt></dd>
</dl>
<dl><dt><strong>message_output_stream</strong></dt>
</dl>
<dl><dt><strong>timeline_model</strong></dt>
</dl>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><strong>DEFAULT_TAB_TIMEOUT</strong> = 60</td></tr></table>
</body></html>