OLD | NEW |
| (Empty) |
1 | |
2 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> | |
3 <html><head><title>Python: module telemetry.internal.browser.extension_page</tit
le> | |
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> <br> | |
10 <font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a hre
f="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry
.internal.html"><font color="#ffffff">internal</font></a>.<a href="telemetry.int
ernal.browser.html"><font color="#ffffff">browser</font></a>.extension_page</str
ong></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/extension_page.py">telemetry/internal/browser/ext
ension_page.py</a></font></td></tr></table> | |
13 <p><tt># Copyright 2012 The Chromium Authors.
All rights reserved.<br> | |
14 # Use of this source code is governed by
a BSD-style license that can be<br> | |
15 # found in the LICENSE 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> <br> | |
20 <font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big
></font></td></tr> | |
21 | |
22 <tr><td bgcolor="#aa55cc"><tt> </tt></td><td>
</td> | |
23 <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=t
op><a href="re.html">re</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></tabl
e></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> <br> | |
29 <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big
></font></td></tr> | |
30 | |
31 <tr><td bgcolor="#ee77aa"><tt> </tt></td><td>
</td> | |
32 <td width="100%"><dl> | |
33 <dt><font face="helvetica, arial"><a href="telemetry.internal.browser.web_conten
ts.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.extension_
page.html#ExtensionPage">ExtensionPage</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> <br> | |
44 <font color="#000000" face="helvetica, arial"><a name="ExtensionPage">class <str
ong>ExtensionPage</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> </tt></td> | |
47 <td colspan=2><tt>Represents an extension page in the&n
bsp;browser<br> </tt></td></tr> | |
48 <tr><td> </td> | |
49 <td width="100%"><dl><dt>Method resolution order:</dt> | |
50 <dd><a href="telemetry.internal.browser.extension_page.html#ExtensionPage">Exten
sionPage</a></dd> | |
51 <dd><a href="telemetry.internal.browser.web_contents.html#WebContents">telemetry
.internal.browser.web_contents.WebContents</a></dd> | |
52 <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> | |
53 </dl> | |
54 <hr> | |
55 Methods defined here:<br> | |
56 <dl><dt><a name="ExtensionPage-Reload"><strong>Reload</strong></a>(self)</dt><dd
><tt>Reloading an extension page is used as a
workaround for an extension<br> | |
57 binding bug for old versions of Chrome (crbug
.com/263162). After Navigate<br> | |
58 returns, we are guaranteed that the inspected 
;page is in the correct state.</tt></dd></dl> | |
59 | |
60 <dl><dt><a name="ExtensionPage-__init__"><strong>__init__</strong></a>(self, ins
pector_backend)</dt></dl> | |
61 | |
62 <hr> | |
63 Methods inherited from <a href="telemetry.internal.browser.web_contents.html#Web
Contents">telemetry.internal.browser.web_contents.WebContents</a>:<br> | |
64 <dl><dt><a name="ExtensionPage-CloseConnections"><strong>CloseConnections</stron
g></a>(self)</dt><dd><tt>Closes all TCP sockets held op
en by the browser.<br> | |
65 <br> | |
66 Raises:<br> | |
67 exceptions.DevtoolsTargetCrashException if the tab&nb
sp;is not alive.</tt></dd></dl> | |
68 | |
69 <dl><dt><a name="ExtensionPage-EnableAllContexts"><strong>EnableAllContexts</str
ong></a>(self)</dt><dd><tt>Enable all contexts in a pag
e. Returns the number of available contexts.<br> | |
70 <br> | |
71 Raises:<br> | |
72 exceptions.WebSocketDisconnected<br> | |
73 exceptions.TimeoutException<br> | |
74 exceptions.DevtoolsTargetCrashException</tt></dd></dl> | |
75 | |
76 <dl><dt><a name="ExtensionPage-EvaluateJavaScript"><strong>EvaluateJavaScript</s
trong></a>(self, expr, timeout<font color="#909090">=90</font>)</dt><dd><tt>Eval
utes expr in JavaScript and returns the JSONi
zed result.<br> | |
77 <br> | |
78 Consider using ExecuteJavaScript for cases where t
he result of the<br> | |
79 expression is not needed.<br> | |
80 <br> | |
81 If evaluation throws in JavaScript, a Python
EvaluateException will<br> | |
82 be raised.<br> | |
83 <br> | |
84 If the result of the evaluation cannot be&nbs
p;JSONized, then an<br> | |
85 EvaluationException will be raised.<br> | |
86 <br> | |
87 Raises:<br> | |
88 exceptions.Error: See <a href="#ExtensionPage-EvaluateJava
ScriptInContext">EvaluateJavaScriptInContext</a>() for a detailed
list<br> | |
89 of possible exceptions.</tt></dd></dl> | |
90 | |
91 <dl><dt><a name="ExtensionPage-EvaluateJavaScriptInContext"><strong>EvaluateJava
ScriptInContext</strong></a>(self, expr, context_id, timeout<font color="#909090
">=90</font>)</dt><dd><tt>Similar to ExecuteJavaScript, except&nb
sp;context_id can refer to an iframe.<br> | |
92 The main page has context_id=1, the first ifr
ame context_id=2, etc.<br> | |
93 <br> | |
94 Raises:<br> | |
95 exceptions.EvaluateException<br> | |
96 exceptions.WebSocketDisconnected<br> | |
97 exceptions.TimeoutException<br> | |
98 exceptions.DevtoolsTargetCrashException</tt></dd></dl> | |
99 | |
100 <dl><dt><a name="ExtensionPage-ExecuteJavaScript"><strong>ExecuteJavaScript</str
ong></a>(self, statement, timeout<font color="#909090">=90</font>)</dt><dd><tt>E
xecutes statement in JavaScript. Does not return&n
bsp;the result.<br> | |
101 <br> | |
102 If the statement failed to evaluate, EvaluateExcep
tion will be raised.<br> | |
103 <br> | |
104 Raises:<br> | |
105 exceptions.Error: See <a href="#ExtensionPage-ExecuteJavaS
criptInContext">ExecuteJavaScriptInContext</a>() for a detailed&n
bsp;list of<br> | |
106 possible exceptions.</tt></dd></dl> | |
107 | |
108 <dl><dt><a name="ExtensionPage-ExecuteJavaScriptInContext"><strong>ExecuteJavaSc
riptInContext</strong></a>(self, expr, context_id, timeout<font color="#909090">
=90</font>)</dt><dd><tt>Similar to ExecuteJavaScript, except 
;context_id can refer to an iframe.<br> | |
109 The main page has context_id=1, the first ifr
ame context_id=2, etc.<br> | |
110 <br> | |
111 Raises:<br> | |
112 exceptions.EvaluateException<br> | |
113 exceptions.WebSocketDisconnected<br> | |
114 exceptions.TimeoutException<br> | |
115 exceptions.DevtoolsTargetCrashException</tt></dd></dl> | |
116 | |
117 <dl><dt><a name="ExtensionPage-GetUrl"><strong>GetUrl</strong></a>(self)</dt><dd
><tt>Returns the URL to which the <a href="telemet
ry.internal.browser.web_contents.html#WebContents">WebContents</a> is
connected.<br> | |
118 <br> | |
119 Raises:<br> | |
120 exceptions.Error: If there is an error 
;in inspector backend connection.</tt></dd></dl> | |
121 | |
122 <dl><dt><a name="ExtensionPage-GetWebviewContexts"><strong>GetWebviewContexts</s
trong></a>(self)</dt><dd><tt>Returns a list of webview
contexts within the current inspector backend.<br> | |
123 <br> | |
124 Returns:<br> | |
125 A list of <a href="telemetry.internal.browser.web_con
tents.html#WebContents">WebContents</a> objects representing the&
nbsp;webview contexts.<br> | |
126 <br> | |
127 Raises:<br> | |
128 exceptions.Error: If there is an error 
;in inspector backend connection.</tt></dd></dl> | |
129 | |
130 <dl><dt><a name="ExtensionPage-HasReachedQuiescence"><strong>HasReachedQuiescenc
e</strong></a>(self)</dt><dd><tt>Determine whether the page
has reached quiescence after loading.<br> | |
131 <br> | |
132 Returns:<br> | |
133 True if 2 seconds have passed since&nb
sp;last resource received, false<br> | |
134 otherwise.<br> | |
135 Raises:<br> | |
136 exceptions.Error: See <a href="#ExtensionPage-EvaluateJava
Script">EvaluateJavaScript</a>() for a detailed list of
<br> | |
137 possible exceptions.</tt></dd></dl> | |
138 | |
139 <dl><dt><a name="ExtensionPage-IsAlive"><strong>IsAlive</strong></a>(self)</dt><
dd><tt>Whether the <a href="telemetry.internal.browser.web_contents.ht
ml#WebContents">WebContents</a> is still operating normally.
<br> | |
140 <br> | |
141 Since <a href="telemetry.internal.browser.web_contents.html#WebContents">We
bContents</a> function asynchronously, this method does
not guarantee<br> | |
142 that the <a href="telemetry.internal.browser.web_contents.html#WebCont
ents">WebContents</a> will still be alive at any&n
bsp;point in the future.<br> | |
143 <br> | |
144 Returns:<br> | |
145 A boolean indicating whether the <a href="t
elemetry.internal.browser.web_contents.html#WebContents">WebContents</a> is
opearting normally.</tt></dd></dl> | |
146 | |
147 <dl><dt><a name="ExtensionPage-Navigate"><strong>Navigate</strong></a>(self, url
, script_to_evaluate_on_commit<font color="#909090">=None</font>, timeout<font c
olor="#909090">=90</font>)</dt><dd><tt>Navigates to url.<br> | |
148 <br> | |
149 If |script_to_evaluate_on_commit| is given, the script&
nbsp;source string will be<br> | |
150 evaluated when the navigation is committed. This&n
bsp;is after the context of<br> | |
151 the page exists, but before any script on&nbs
p;the page itself has executed.<br> | |
152 <br> | |
153 Raises:<br> | |
154 exceptions.TimeoutException<br> | |
155 exceptions.DevtoolsTargetCrashException</tt></dd></dl> | |
156 | |
157 <dl><dt><a name="ExtensionPage-StartTimelineRecording"><strong>StartTimelineReco
rding</strong></a>(self)</dt><dd><tt>Starts timeline recording.<br> | |
158 <br> | |
159 Raises:<br> | |
160 exceptions.TimeoutException<br> | |
161 exceptions.DevtoolsTargetCrashException</tt></dd></dl> | |
162 | |
163 <dl><dt><a name="ExtensionPage-StopTimelineRecording"><strong>StopTimelineRecord
ing</strong></a>(self)</dt><dd><tt>Stops timeline recording.<br> | |
164 <br> | |
165 Raises:<br> | |
166 exceptions.TimeoutException<br> | |
167 exceptions.DevtoolsTargetCrashException</tt></dd></dl> | |
168 | |
169 <dl><dt><a name="ExtensionPage-SynthesizeScrollGesture"><strong>SynthesizeScroll
Gesture</strong></a>(self, x<font color="#909090">=100</font>, y<font color="#90
9090">=800</font>, xDistance<font color="#909090">=0</font>, yDistance<font colo
r="#909090">=-500</font>, xOverscroll<font color="#909090">=None</font>, yOversc
roll<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>, repeatDelay
Ms<font color="#909090">=None</font>, interactionMarkerName<font color="#909090"
>=None</font>)</dt><dd><tt>Runs an inspector command that&nb
sp;causes a repeatable browser driven scroll.<br> | |
170 <br> | |
171 Args:<br> | |
172 x: X coordinate of the start of t
he gesture in CSS pixels.<br> | |
173 y: Y coordinate of the start of t
he gesture in CSS pixels.<br> | |
174 xDistance: Distance to scroll along the&nbs
p;X axis (positive to scroll left).<br> | |
175 yDistance: Ddistance to scroll along the&nb
sp;Y axis (positive to scroll up).<br> | |
176 xOverscroll: Number of additional pixels to
scroll back along the X axis.<br> | |
177 xOverscroll: Number of additional pixels to
scroll back along the Y axis.<br> | |
178 preventFling: Prevents a fling gesture.<br> | |
179 speed: Swipe speed in pixels per secon
d.<br> | |
180 gestureSourceType: Which type of input even
ts to be generated.<br> | |
181 repeatCount: Number of additional repeats b
eyond the first scroll.<br> | |
182 repeatDelayMs: Number of milliseconds delay 
;between each repeat.<br> | |
183 interactionMarkerName: The name of the inte
raction markers to generate.<br> | |
184 <br> | |
185 Raises:<br> | |
186 exceptions.TimeoutException<br> | |
187 exceptions.DevtoolsTargetCrashException</tt></dd></dl> | |
188 | |
189 <dl><dt><a name="ExtensionPage-WaitForDocumentReadyStateToBeComplete"><strong>Wa
itForDocumentReadyStateToBeComplete</strong></a>(self, timeout<font color="#9090
90">=90</font>)</dt><dd><tt>Waits for the document to f
inish loading.<br> | |
190 <br> | |
191 Raises:<br> | |
192 exceptions.Error: See <a href="#ExtensionPage-WaitForJavaS
criptExpression">WaitForJavaScriptExpression</a>() for a detailed
list<br> | |
193 of possible exceptions.</tt></dd></dl> | |
194 | |
195 <dl><dt><a name="ExtensionPage-WaitForDocumentReadyStateToBeInteractiveOrBetter"
><strong>WaitForDocumentReadyStateToBeInteractiveOrBetter</strong></a>(self, tim
eout<font color="#909090">=90</font>)</dt><dd><tt>Waits for the d
ocument to be interactive.<br> | |
196 <br> | |
197 Raises:<br> | |
198 exceptions.Error: See <a href="#ExtensionPage-WaitForJavaS
criptExpression">WaitForJavaScriptExpression</a>() for a detailed
list<br> | |
199 of possible exceptions.</tt></dd></dl> | |
200 | |
201 <dl><dt><a name="ExtensionPage-WaitForJavaScriptExpression"><strong>WaitForJavaS
criptExpression</strong></a>(self, expr, timeout, dump_page_state_on_timeout<fon
t color="#909090">=True</font>)</dt><dd><tt>Waits for the given&n
bsp;JavaScript expression to be True.<br> | |
202 <br> | |
203 This method is robust against any given Evalu
ation timing out.<br> | |
204 <br> | |
205 Args:<br> | |
206 expr: The expression to evaluate.<br> | |
207 timeout: The number of seconds to wait
for the expression to be True.<br> | |
208 dump_page_state_on_timeout: Whether to provide a
dditional information on<br> | |
209 the page state if a 
;TimeoutException is thrown.<br> | |
210 <br> | |
211 Raises:<br> | |
212 exceptions.TimeoutException: On a timeout.<br> | |
213 exceptions.Error: See <a href="#ExtensionPage-EvaluateJava
Script">EvaluateJavaScript</a>() for a detailed list of
<br> | |
214 possible exceptions.</tt></dd></dl> | |
215 | |
216 <dl><dt><a name="ExtensionPage-WaitForNavigate"><strong>WaitForNavigate</strong>
</a>(self, timeout<font color="#909090">=90</font>)</dt><dd><tt>Waits for&n
bsp;the navigation to complete.<br> | |
217 <br> | |
218 The current page is expect to be in a&nb
sp;navigation.<br> | |
219 This function returns when the navigation is
complete or when<br> | |
220 the timeout has been exceeded.<br> | |
221 <br> | |
222 Raises:<br> | |
223 exceptions.TimeoutException<br> | |
224 exceptions.DevtoolsTargetCrashException</tt></dd></dl> | |
225 | |
226 <hr> | |
227 Data descriptors inherited from <a href="telemetry.internal.browser.web_contents
.html#WebContents">telemetry.internal.browser.web_contents.WebContents</a>:<br> | |
228 <dl><dt><strong>__dict__</strong></dt> | |
229 <dd><tt>dictionary for instance variables (if defined)<
/tt></dd> | |
230 </dl> | |
231 <dl><dt><strong>__weakref__</strong></dt> | |
232 <dd><tt>list of weak references to the object 
;(if defined)</tt></dd> | |
233 </dl> | |
234 <dl><dt><strong>id</strong></dt> | |
235 <dd><tt>Return the unique id string for this
tab object.</tt></dd> | |
236 </dl> | |
237 <dl><dt><strong>message_output_stream</strong></dt> | |
238 </dl> | |
239 <dl><dt><strong>timeline_model</strong></dt> | |
240 </dl> | |
241 </td></tr></table></td></tr></table><p> | |
242 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> | |
243 <tr bgcolor="#eeaa77"> | |
244 <td colspan=3 valign=bottom> <br> | |
245 <font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></b
ig></font></td></tr> | |
246 | |
247 <tr><td bgcolor="#eeaa77"><tt> </tt></td><td>
</td> | |
248 <td width="100%"><dl><dt><a name="-UrlToExtensionId"><strong>UrlToExtensionId</s
trong></a>(url)</dt></dl> | |
249 </td></tr></table> | |
250 </body></html> | |
OLD | NEW |