Home | History | Annotate | Download | only in pydoc
      1 
      2 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
      3 <html><head><title>Python: module telemetry.internal.browser.tab</title>
      4 <meta charset="utf-8">
      5 </head><body bgcolor="#f0f0f8">
      6 
      7 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
      8 <tr bgcolor="#7799ee">
      9 <td valign=bottom>&nbsp;<br>
     10 <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
     11 ><td align=right valign=bottom
     12 ><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>
     13     <p><tt>#&nbsp;Copyright&nbsp;2012&nbsp;The&nbsp;Chromium&nbsp;Authors.&nbsp;All&nbsp;rights&nbsp;reserved.<br>
     14 #&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>
     15 #&nbsp;found&nbsp;in&nbsp;the&nbsp;LICENSE&nbsp;file.</tt></p>
     16 <p>
     17 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
     18 <tr bgcolor="#aa55cc">
     19 <td colspan=3 valign=bottom>&nbsp;<br>
     20 <font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
     21     
     22 <tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
     23 <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>
     24 </td><td width="25%" valign=top><a href="telemetry.internal.browser.web_contents.html">telemetry.internal.browser.web_contents</a><br>
     25 </td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
     26 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
     27 <tr bgcolor="#ee77aa">
     28 <td colspan=3 valign=bottom>&nbsp;<br>
     29 <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
     30     
     31 <tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
     32 <td width="100%"><dl>
     33 <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>)
     34 </font></dt><dd>
     35 <dl>
     36 <dt><font face="helvetica, arial"><a href="telemetry.internal.browser.tab.html#Tab">Tab</a>
     37 </font></dt></dl>
     38 </dd>
     39 </dl>
     40  <p>
     41 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
     42 <tr bgcolor="#ffc8d8">
     43 <td colspan=3 valign=bottom>&nbsp;<br>
     44 <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>
     45     
     46 <tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
     47 <td colspan=2><tt>Represents&nbsp;a&nbsp;tab&nbsp;in&nbsp;the&nbsp;browser<br>
     48 &nbsp;<br>
     49 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>
     50 E.g.:<br>
     51 &nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Navigates&nbsp;the&nbsp;tab&nbsp;to&nbsp;a&nbsp;given&nbsp;url.<br>
     52 &nbsp;&nbsp;&nbsp;&nbsp;tab.<a href="#Tab-Navigate">Navigate</a>('<a href="http://www.google.com/">http://www.google.com/</a>')<br>
     53 &nbsp;<br>
     54 &nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Evaluates&nbsp;1+1&nbsp;in&nbsp;the&nbsp;tab's&nbsp;JavaScript&nbsp;context.<br>
     55 &nbsp;&nbsp;&nbsp;&nbsp;tab.Evaluate('1+1')<br>&nbsp;</tt></td></tr>
     56 <tr><td>&nbsp;</td>
     57 <td width="100%"><dl><dt>Method resolution order:</dt>
     58 <dd><a href="telemetry.internal.browser.tab.html#Tab">Tab</a></dd>
     59 <dd><a href="telemetry.internal.browser.web_contents.html#WebContents">telemetry.internal.browser.web_contents.WebContents</a></dd>
     60 <dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
     61 </dl>
     62 <hr>
     63 Methods defined here:<br>
     64 <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>
     65 &nbsp;<br>
     66 Not&nbsp;all&nbsp;browsers&nbsp;or&nbsp;browser&nbsp;versions&nbsp;support&nbsp;this&nbsp;method.<br>
     67 Be&nbsp;sure&nbsp;to&nbsp;check&nbsp;browser.supports_tab_control.<br>
     68 &nbsp;<br>
     69 Please&nbsp;note:&nbsp;this&nbsp;is&nbsp;asynchronous.&nbsp;There&nbsp;is&nbsp;a&nbsp;delay&nbsp;between&nbsp;this&nbsp;call<br>
     70 and&nbsp;the&nbsp;page's&nbsp;documentVisibilityState&nbsp;becoming&nbsp;'visible',&nbsp;and&nbsp;yet&nbsp;more<br>
     71 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>
     72 are&nbsp;included&nbsp;in&nbsp;this&nbsp;call.<br>
     73 &nbsp;<br>
     74 Raises:<br>
     75 &nbsp;&nbsp;devtools_http.DevToolsClientConnectionError<br>
     76 &nbsp;&nbsp;devtools_client_backend.TabNotFoundError<br>
     77 &nbsp;&nbsp;tab_list_backend.TabUnexpectedResponseException</tt></dd></dl>
     78 
     79 <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>
     80 &nbsp;<br>
     81 Args:<br>
     82 &nbsp;&nbsp;force:&nbsp;Iff&nbsp;true,&nbsp;navigates&nbsp;to&nbsp;about:blank&nbsp;which&nbsp;destroys&nbsp;the&nbsp;previous<br>
     83 &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>
     84 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cleared.<br>
     85 &nbsp;<br>
     86 Raises:<br>
     87 &nbsp;&nbsp;exceptions.EvaluateException<br>
     88 &nbsp;&nbsp;exceptions.WebSocketDisconnected<br>
     89 &nbsp;&nbsp;exceptions.TimeoutException<br>
     90 &nbsp;&nbsp;exceptions.DevtoolsTargetCrashException<br>
     91 &nbsp;&nbsp;errors.DeviceUnresponsiveError</tt></dd></dl>
     92 
     93 <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>
     94 &nbsp;<br>
     95 Raises:<br>
     96 &nbsp;&nbsp;exceptions.EvaluateException<br>
     97 &nbsp;&nbsp;exceptions.WebSocketDisconnected<br>
     98 &nbsp;&nbsp;exceptions.TimeoutException<br>
     99 &nbsp;&nbsp;exceptions.DevtoolsTargetCrashException</tt></dd></dl>
    100 
    101 <dl><dt><a name="Tab-Close"><strong>Close</strong></a>(self)</dt><dd><tt>Closes&nbsp;this&nbsp;tab.<br>
    102 &nbsp;<br>
    103 Not&nbsp;all&nbsp;browsers&nbsp;or&nbsp;browser&nbsp;versions&nbsp;support&nbsp;this&nbsp;method.<br>
    104 Be&nbsp;sure&nbsp;to&nbsp;check&nbsp;browser.supports_tab_control.<br>
    105 &nbsp;<br>
    106 Raises:<br>
    107 &nbsp;&nbsp;devtools_http.DevToolsClientConnectionError<br>
    108 &nbsp;&nbsp;devtools_client_backend.TabNotFoundError<br>
    109 &nbsp;&nbsp;tab_list_backend.TabUnexpectedResponseException<br>
    110 &nbsp;&nbsp;exceptions.TimeoutException</tt></dd></dl>
    111 
    112 <dl><dt><a name="Tab-CollectGarbage"><strong>CollectGarbage</strong></a>(self)</dt><dd><tt>Forces&nbsp;a&nbsp;garbage&nbsp;collection.<br>
    113 &nbsp;<br>
    114 Raises:<br>
    115 &nbsp;&nbsp;exceptions.WebSocketDisconnected<br>
    116 &nbsp;&nbsp;exceptions.TimeoutException<br>
    117 &nbsp;&nbsp;exceptions.DevtoolsTargetCrashException</tt></dd></dl>
    118 
    119 <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>
    120 &nbsp;<br>
    121 Raises:<br>
    122 &nbsp;&nbsp;exceptions.WebSocketDisconnected<br>
    123 &nbsp;&nbsp;exceptions.TimeoutException<br>
    124 &nbsp;&nbsp;exceptions.DevtoolsTargetCrashException</tt></dd></dl>
    125 
    126 <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>
    127 &nbsp;<br>
    128 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>
    129 all&nbsp;pages.&nbsp;If&nbsp;this&nbsp;happens,&nbsp;DevTools&nbsp;also&nbsp;provides&nbsp;a&nbsp;method&nbsp;for&nbsp;this.<br>
    130 &nbsp;<br>
    131 Raises:<br>
    132 &nbsp;&nbsp;exceptions.EvaluateException<br>
    133 &nbsp;&nbsp;exceptions.WebSocketDisconnected<br>
    134 &nbsp;&nbsp;exceptions.TimeoutException<br>
    135 &nbsp;&nbsp;exceptions.DevtoolsTargetCrashException</tt></dd></dl>
    136 
    137 <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>
    138 &nbsp;<br>
    139 Returns:<br>
    140 &nbsp;&nbsp;A&nbsp;telemetry.core.Bitmap.<br>
    141 Raises:<br>
    142 &nbsp;&nbsp;exceptions.WebSocketDisconnected<br>
    143 &nbsp;&nbsp;exceptions.TimeoutException<br>
    144 &nbsp;&nbsp;exceptions.DevtoolsTargetCrashException</tt></dd></dl>
    145 
    146 <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>
    147 &nbsp;<br>
    148 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>
    149 starting&nbsp;video&nbsp;recording.&nbsp;When&nbsp;the&nbsp;frames&nbsp;are&nbsp;processed,&nbsp;we&nbsp;can&nbsp;look&nbsp;for<br>
    150 that&nbsp;flash&nbsp;as&nbsp;the&nbsp;content&nbsp;bounds.<br>
    151 &nbsp;<br>
    152 Args:<br>
    153 &nbsp;&nbsp;min_bitrate_mbps:&nbsp;The&nbsp;minimum&nbsp;caputre&nbsp;bitrate&nbsp;in&nbsp;MegaBits&nbsp;Per&nbsp;Second.<br>
    154 &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>
    155 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;without&nbsp;increasing&nbsp;overhead.<br>
    156 &nbsp;<br>
    157 Raises:<br>
    158 &nbsp;&nbsp;exceptions.EvaluateException<br>
    159 &nbsp;&nbsp;exceptions.WebSocketDisconnected<br>
    160 &nbsp;&nbsp;exceptions.TimeoutException<br>
    161 &nbsp;&nbsp;exceptions.DevtoolsTargetCrashException<br>
    162 &nbsp;&nbsp;ValueError:&nbsp;If&nbsp;the&nbsp;required&nbsp;|min_bitrate_mbps|&nbsp;can't&nbsp;be&nbsp;achieved.</tt></dd></dl>
    163 
    164 <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>
    165 &nbsp;<br>
    166 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>
    167 tab&nbsp;content&nbsp;boundaries&nbsp;and&nbsp;then&nbsp;omits&nbsp;all&nbsp;frames&nbsp;displaying&nbsp;the&nbsp;flash.<br>
    168 &nbsp;<br>
    169 Returns:<br>
    170 &nbsp;&nbsp;video:&nbsp;A&nbsp;video&nbsp;object&nbsp;which&nbsp;is&nbsp;a&nbsp;telemetry.core.Video</tt></dd></dl>
    171 
    172 <dl><dt><a name="Tab-__init__"><strong>__init__</strong></a>(self, inspector_backend, tab_list_backend, browser)</dt></dl>
    173 
    174 <hr>
    175 Data descriptors defined here:<br>
    176 <dl><dt><strong>browser</strong></dt>
    177 <dd><tt>The&nbsp;browser&nbsp;in&nbsp;which&nbsp;this&nbsp;tab&nbsp;resides.</tt></dd>
    178 </dl>
    179 <dl><dt><strong>dom_stats</strong></dt>
    180 <dd><tt>A&nbsp;dictionary&nbsp;populated&nbsp;with&nbsp;measured&nbsp;DOM&nbsp;statistics.<br>
    181 &nbsp;<br>
    182 Currently&nbsp;this&nbsp;dictionary&nbsp;contains:<br>
    183 {<br>
    184 &nbsp;&nbsp;'document_count':&nbsp;integer,<br>
    185 &nbsp;&nbsp;'node_count':&nbsp;integer,<br>
    186 &nbsp;&nbsp;'event_listener_count':&nbsp;integer<br>
    187 }<br>
    188 &nbsp;<br>
    189 Raises:<br>
    190 &nbsp;&nbsp;inspector_memory.InspectorMemoryException<br>
    191 &nbsp;&nbsp;exceptions.TimeoutException<br>
    192 &nbsp;&nbsp;exceptions.DevtoolsTargetCrashException</tt></dd>
    193 </dl>
    194 <dl><dt><strong>is_video_capture_running</strong></dt>
    195 </dl>
    196 <dl><dt><strong>screenshot_supported</strong></dt>
    197 <dd><tt>True&nbsp;if&nbsp;the&nbsp;browser&nbsp;instance&nbsp;is&nbsp;capable&nbsp;of&nbsp;capturing&nbsp;screenshots.</tt></dd>
    198 </dl>
    199 <dl><dt><strong>url</strong></dt>
    200 <dd><tt>Returns&nbsp;the&nbsp;URL&nbsp;of&nbsp;the&nbsp;tab,&nbsp;as&nbsp;reported&nbsp;by&nbsp;devtools.<br>
    201 &nbsp;<br>
    202 Raises:<br>
    203 &nbsp;&nbsp;devtools_http.DevToolsClientConnectionError</tt></dd>
    204 </dl>
    205 <dl><dt><strong>video_capture_supported</strong></dt>
    206 <dd><tt>True&nbsp;if&nbsp;the&nbsp;browser&nbsp;instance&nbsp;is&nbsp;capable&nbsp;of&nbsp;capturing&nbsp;video.</tt></dd>
    207 </dl>
    208 <hr>
    209 Methods inherited from <a href="telemetry.internal.browser.web_contents.html#WebContents">telemetry.internal.browser.web_contents.WebContents</a>:<br>
    210 <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>
    211 &nbsp;<br>
    212 Raises:<br>
    213 &nbsp;&nbsp;exceptions.DevtoolsTargetCrashException&nbsp;if&nbsp;the&nbsp;tab&nbsp;is&nbsp;not&nbsp;alive.</tt></dd></dl>
    214 
    215 <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>
    216 &nbsp;<br>
    217 Raises:<br>
    218 &nbsp;&nbsp;exceptions.WebSocketDisconnected<br>
    219 &nbsp;&nbsp;exceptions.TimeoutException<br>
    220 &nbsp;&nbsp;exceptions.DevtoolsTargetCrashException</tt></dd></dl>
    221 
    222 <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>
    223 &nbsp;<br>
    224 Consider&nbsp;using&nbsp;ExecuteJavaScript&nbsp;for&nbsp;cases&nbsp;where&nbsp;the&nbsp;result&nbsp;of&nbsp;the<br>
    225 expression&nbsp;is&nbsp;not&nbsp;needed.<br>
    226 &nbsp;<br>
    227 If&nbsp;evaluation&nbsp;throws&nbsp;in&nbsp;JavaScript,&nbsp;a&nbsp;Python&nbsp;EvaluateException&nbsp;will<br>
    228 be&nbsp;raised.<br>
    229 &nbsp;<br>
    230 If&nbsp;the&nbsp;result&nbsp;of&nbsp;the&nbsp;evaluation&nbsp;cannot&nbsp;be&nbsp;JSONized,&nbsp;then&nbsp;an<br>
    231 EvaluationException&nbsp;will&nbsp;be&nbsp;raised.<br>
    232 &nbsp;<br>
    233 Raises:<br>
    234 &nbsp;&nbsp;exceptions.Error:&nbsp;See&nbsp;<a href="#Tab-EvaluateJavaScriptInContext">EvaluateJavaScriptInContext</a>()&nbsp;for&nbsp;a&nbsp;detailed&nbsp;list<br>
    235 &nbsp;&nbsp;of&nbsp;possible&nbsp;exceptions.</tt></dd></dl>
    236 
    237 <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>
    238 The&nbsp;main&nbsp;page&nbsp;has&nbsp;context_id=1,&nbsp;the&nbsp;first&nbsp;iframe&nbsp;context_id=2,&nbsp;etc.<br>
    239 &nbsp;<br>
    240 Raises:<br>
    241 &nbsp;&nbsp;exceptions.EvaluateException<br>
    242 &nbsp;&nbsp;exceptions.WebSocketDisconnected<br>
    243 &nbsp;&nbsp;exceptions.TimeoutException<br>
    244 &nbsp;&nbsp;exceptions.DevtoolsTargetCrashException</tt></dd></dl>
    245 
    246 <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>
    247 &nbsp;<br>
    248 If&nbsp;the&nbsp;statement&nbsp;failed&nbsp;to&nbsp;evaluate,&nbsp;EvaluateException&nbsp;will&nbsp;be&nbsp;raised.<br>
    249 &nbsp;<br>
    250 Raises:<br>
    251 &nbsp;&nbsp;exceptions.Error:&nbsp;See&nbsp;<a href="#Tab-ExecuteJavaScriptInContext">ExecuteJavaScriptInContext</a>()&nbsp;for&nbsp;a&nbsp;detailed&nbsp;list&nbsp;of<br>
    252 &nbsp;&nbsp;possible&nbsp;exceptions.</tt></dd></dl>
    253 
    254 <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>
    255 The&nbsp;main&nbsp;page&nbsp;has&nbsp;context_id=1,&nbsp;the&nbsp;first&nbsp;iframe&nbsp;context_id=2,&nbsp;etc.<br>
    256 &nbsp;<br>
    257 Raises:<br>
    258 &nbsp;&nbsp;exceptions.EvaluateException<br>
    259 &nbsp;&nbsp;exceptions.WebSocketDisconnected<br>
    260 &nbsp;&nbsp;exceptions.TimeoutException<br>
    261 &nbsp;&nbsp;exceptions.DevtoolsTargetCrashException</tt></dd></dl>
    262 
    263 <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>
    264 &nbsp;<br>
    265 Raises:<br>
    266 &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>
    267 
    268 <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>
    269 &nbsp;<br>
    270 Returns:<br>
    271 &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>
    272 &nbsp;<br>
    273 Raises:<br>
    274 &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>
    275 
    276 <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>
    277 &nbsp;<br>
    278 Returns:<br>
    279 &nbsp;&nbsp;True&nbsp;if&nbsp;2&nbsp;seconds&nbsp;have&nbsp;passed&nbsp;since&nbsp;last&nbsp;resource&nbsp;received,&nbsp;false<br>
    280 &nbsp;&nbsp;otherwise.<br>
    281 Raises:<br>
    282 &nbsp;&nbsp;exceptions.Error:&nbsp;See&nbsp;<a href="#Tab-EvaluateJavaScript">EvaluateJavaScript</a>()&nbsp;for&nbsp;a&nbsp;detailed&nbsp;list&nbsp;of<br>
    283 &nbsp;&nbsp;possible&nbsp;exceptions.</tt></dd></dl>
    284 
    285 <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>
    286 &nbsp;<br>
    287 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>
    288 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>
    289 &nbsp;<br>
    290 Returns:<br>
    291 &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>
    292 
    293 <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>
    294 &nbsp;<br>
    295 If&nbsp;|script_to_evaluate_on_commit|&nbsp;is&nbsp;given,&nbsp;the&nbsp;script&nbsp;source&nbsp;string&nbsp;will&nbsp;be<br>
    296 evaluated&nbsp;when&nbsp;the&nbsp;navigation&nbsp;is&nbsp;committed.&nbsp;This&nbsp;is&nbsp;after&nbsp;the&nbsp;context&nbsp;of<br>
    297 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>
    298 &nbsp;<br>
    299 Raises:<br>
    300 &nbsp;&nbsp;exceptions.TimeoutException<br>
    301 &nbsp;&nbsp;exceptions.DevtoolsTargetCrashException</tt></dd></dl>
    302 
    303 <dl><dt><a name="Tab-StartTimelineRecording"><strong>StartTimelineRecording</strong></a>(self)</dt><dd><tt>Starts&nbsp;timeline&nbsp;recording.<br>
    304 &nbsp;<br>
    305 Raises:<br>
    306 &nbsp;&nbsp;exceptions.TimeoutException<br>
    307 &nbsp;&nbsp;exceptions.DevtoolsTargetCrashException</tt></dd></dl>
    308 
    309 <dl><dt><a name="Tab-StopTimelineRecording"><strong>StopTimelineRecording</strong></a>(self)</dt><dd><tt>Stops&nbsp;timeline&nbsp;recording.<br>
    310 &nbsp;<br>
    311 Raises:<br>
    312 &nbsp;&nbsp;exceptions.TimeoutException<br>
    313 &nbsp;&nbsp;exceptions.DevtoolsTargetCrashException</tt></dd></dl>
    314 
    315 <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>
    316 &nbsp;<br>
    317 Args:<br>
    318 &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>
    319 &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>
    320 &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>
    321 &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>
    322 &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>
    323 &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>
    324 &nbsp;&nbsp;preventFling:&nbsp;Prevents&nbsp;a&nbsp;fling&nbsp;gesture.<br>
    325 &nbsp;&nbsp;speed:&nbsp;Swipe&nbsp;speed&nbsp;in&nbsp;pixels&nbsp;per&nbsp;second.<br>
    326 &nbsp;&nbsp;gestureSourceType:&nbsp;Which&nbsp;type&nbsp;of&nbsp;input&nbsp;events&nbsp;to&nbsp;be&nbsp;generated.<br>
    327 &nbsp;&nbsp;repeatCount:&nbsp;Number&nbsp;of&nbsp;additional&nbsp;repeats&nbsp;beyond&nbsp;the&nbsp;first&nbsp;scroll.<br>
    328 &nbsp;&nbsp;repeatDelayMs:&nbsp;Number&nbsp;of&nbsp;milliseconds&nbsp;delay&nbsp;between&nbsp;each&nbsp;repeat.<br>
    329 &nbsp;&nbsp;interactionMarkerName:&nbsp;The&nbsp;name&nbsp;of&nbsp;the&nbsp;interaction&nbsp;markers&nbsp;to&nbsp;generate.<br>
    330 &nbsp;<br>
    331 Raises:<br>
    332 &nbsp;&nbsp;exceptions.TimeoutException<br>
    333 &nbsp;&nbsp;exceptions.DevtoolsTargetCrashException</tt></dd></dl>
    334 
    335 <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>
    336 &nbsp;<br>
    337 Raises:<br>
    338 &nbsp;&nbsp;exceptions.Error:&nbsp;See&nbsp;<a href="#Tab-WaitForJavaScriptExpression">WaitForJavaScriptExpression</a>()&nbsp;for&nbsp;a&nbsp;detailed&nbsp;list<br>
    339 &nbsp;&nbsp;of&nbsp;possible&nbsp;exceptions.</tt></dd></dl>
    340 
    341 <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>
    342 &nbsp;<br>
    343 Raises:<br>
    344 &nbsp;&nbsp;exceptions.Error:&nbsp;See&nbsp;<a href="#Tab-WaitForJavaScriptExpression">WaitForJavaScriptExpression</a>()&nbsp;for&nbsp;a&nbsp;detailed&nbsp;list<br>
    345 &nbsp;&nbsp;of&nbsp;possible&nbsp;exceptions.</tt></dd></dl>
    346 
    347 <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>
    348 &nbsp;<br>
    349 This&nbsp;method&nbsp;is&nbsp;robust&nbsp;against&nbsp;any&nbsp;given&nbsp;Evaluation&nbsp;timing&nbsp;out.<br>
    350 &nbsp;<br>
    351 Args:<br>
    352 &nbsp;&nbsp;expr:&nbsp;The&nbsp;expression&nbsp;to&nbsp;evaluate.<br>
    353 &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>
    354 &nbsp;&nbsp;dump_page_state_on_timeout:&nbsp;Whether&nbsp;to&nbsp;provide&nbsp;additional&nbsp;information&nbsp;on<br>
    355 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;page&nbsp;state&nbsp;if&nbsp;a&nbsp;TimeoutException&nbsp;is&nbsp;thrown.<br>
    356 &nbsp;<br>
    357 Raises:<br>
    358 &nbsp;&nbsp;exceptions.TimeoutException:&nbsp;On&nbsp;a&nbsp;timeout.<br>
    359 &nbsp;&nbsp;exceptions.Error:&nbsp;See&nbsp;<a href="#Tab-EvaluateJavaScript">EvaluateJavaScript</a>()&nbsp;for&nbsp;a&nbsp;detailed&nbsp;list&nbsp;of<br>
    360 &nbsp;&nbsp;possible&nbsp;exceptions.</tt></dd></dl>
    361 
    362 <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>
    363 &nbsp;<br>
    364 The&nbsp;current&nbsp;page&nbsp;is&nbsp;expect&nbsp;to&nbsp;be&nbsp;in&nbsp;a&nbsp;navigation.<br>
    365 This&nbsp;function&nbsp;returns&nbsp;when&nbsp;the&nbsp;navigation&nbsp;is&nbsp;complete&nbsp;or&nbsp;when<br>
    366 the&nbsp;timeout&nbsp;has&nbsp;been&nbsp;exceeded.<br>
    367 &nbsp;<br>
    368 Raises:<br>
    369 &nbsp;&nbsp;exceptions.TimeoutException<br>
    370 &nbsp;&nbsp;exceptions.DevtoolsTargetCrashException</tt></dd></dl>
    371 
    372 <hr>
    373 Data descriptors inherited from <a href="telemetry.internal.browser.web_contents.html#WebContents">telemetry.internal.browser.web_contents.WebContents</a>:<br>
    374 <dl><dt><strong>__dict__</strong></dt>
    375 <dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
    376 </dl>
    377 <dl><dt><strong>__weakref__</strong></dt>
    378 <dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
    379 </dl>
    380 <dl><dt><strong>id</strong></dt>
    381 <dd><tt>Return&nbsp;the&nbsp;unique&nbsp;id&nbsp;string&nbsp;for&nbsp;this&nbsp;tab&nbsp;object.</tt></dd>
    382 </dl>
    383 <dl><dt><strong>message_output_stream</strong></dt>
    384 </dl>
    385 <dl><dt><strong>timeline_model</strong></dt>
    386 </dl>
    387 </td></tr></table></td></tr></table><p>
    388 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
    389 <tr bgcolor="#55aa55">
    390 <td colspan=3 valign=bottom>&nbsp;<br>
    391 <font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
    392     
    393 <tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
    394 <td width="100%"><strong>DEFAULT_TAB_TIMEOUT</strong> = 60</td></tr></table>
    395 </body></html>