Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Side by Side Diff: chrome/common/extensions/docs/static/webNavigation.html

Issue 10807009: Include the processId in webNavigation events (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <div id="pageData-name" class="pageData">WebNavigation API</div> 1 <div id="pageData-name" class="pageData">WebNavigation API</div>
2 2
3 <!-- BEGIN AUTHORED CONTENT --> 3 <!-- BEGIN AUTHORED CONTENT -->
4 <p id="classSummary"> 4 <p id="classSummary">
5 Use the <code>chrome.webNavigation</code> module to receive 5 Use the <code>chrome.webNavigation</code> module to receive
6 notifications about the status of navigations requests in-flight. 6 notifications about the status of navigations requests in-flight.
7 </p> 7 </p>
8 8
9 <h2>Manifest</h2> 9 <h2>Manifest</h2>
10 <p> 10 <p>
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 <code>onCompleted</code> is fired after all of its children's 53 <code>onCompleted</code> is fired after all of its children's
54 <code>onCompleted</code>. 54 <code>onCompleted</code>.
55 </p> 55 </p>
56 <p> 56 <p>
57 If the reference fragment of a frame is changed, a 57 If the reference fragment of a frame is changed, a
58 <code>onReferenceFragmentUpdated</code> event is fired. This event can fire any 58 <code>onReferenceFragmentUpdated</code> event is fired. This event can fire any
59 time after <code>onDOMContentLoaded</code>, even after 59 time after <code>onDOMContentLoaded</code>, even after
60 <code>onCompleted</code>. 60 <code>onCompleted</code>.
61 </p> 61 </p>
62 <p> 62 <p>
63 If the history API is used to modify the state of a frame (e.g. using
64 <code>history.pushState()</code>, a <code>onHistoryStateUpdated</code> event is
65 fired. This event can fire any time after <code>onDOMContentLoaded</code>.
66 </p>
67 <p>
63 If a navigation was triggered via <a 68 If a navigation was triggered via <a
64 href="https://support.google.com/chrome/bin/answer.py?answer=177873">Chrome 69 href="https://support.google.com/chrome/bin/answer.py?answer=177873">Chrome
65 Instant</a> or <a 70 Instant</a> or <a
66 href="https://support.google.com/chrome/bin/answer.py?answer=1385029">Instant 71 href="https://support.google.com/chrome/bin/answer.py?answer=1385029">Instant
67 Pages</a>, a completely loaded page is swapped into the current tab. In that 72 Pages</a>, a completely loaded page is swapped into the current tab. In that
68 case, an <code>onTabReplaced</code> event is fired. 73 case, an <code>onTabReplaced</code> event is fired.
69 </p> 74 </p>
70 75
71 <h2>Relation to webRequest events</h2> 76 <h2>Relation to webRequest events</h2>
72 <p> 77 <p>
(...skipping 24 matching lines...) Expand all
97 It's important to note that some technical oddities in the OS's handling 102 It's important to note that some technical oddities in the OS's handling
98 of distinct Chrome processes can cause the clock to be skewed between the 103 of distinct Chrome processes can cause the clock to be skewed between the
99 browser itself and extension processes. That means that WebNavigation's events' 104 browser itself and extension processes. That means that WebNavigation's events'
100 <code>timeStamp</code> property is only guaranteed to be <i>internally</i> 105 <code>timeStamp</code> property is only guaranteed to be <i>internally</i>
101 consistent. Comparing one event to another event will give you the correct 106 consistent. Comparing one event to another event will give you the correct
102 offset between them, but comparing them to the current time inside the 107 offset between them, but comparing them to the current time inside the
103 extension (via <code>(new Date()).getTime()</code>, for instance) might give 108 extension (via <code>(new Date()).getTime()</code>, for instance) might give
104 unexpected results. 109 unexpected results.
105 </p> 110 </p>
106 111
112 <h2>A note about frame and process IDs</h2>
113 <p>
114 Due to the multi-process nature of Chrome, a tab might use different processes
115 to render the source and destination of a web page. Therefore, if a navigation
116 takes place in a new process, you might receive events both from the new and
117 the old page until the new navigation is committed (i.e. the
118 <code>onCommitted</code> event is send for the new main frame). Because frame
119 IDs are only unique for a given process, the webNavigation events include a
120 process ID, so you can still determine which frame a navigation came from.
121 </p>
122 <p>
123 Also note that during a provisional load the process might be switched several
124 times. This happens when the load is redirected to a different site. In this
125 case, you will receive repeated <code>onBeforeNavigate</code> and
126 <code>onErrorOccurred</code> events, until you receive the final
127 <code>onCommitted</code> event.
128 </p>
129
107 <h2>Transition types and qualifiers</h2> 130 <h2>Transition types and qualifiers</h2>
108 <p> 131 <p>
109 The webNavigation API's <code>onCommitted</code> event has a 132 The webNavigation API's <code>onCommitted</code> event has a
110 <code>transitionType</code> and a <code>transitionQualifiers</code> property. 133 <code>transitionType</code> and a <code>transitionQualifiers</code> property.
111 The <em>transition type</em> is the same as used in the <a 134 The <em>transition type</em> is the same as used in the <a
112 href="history.html#transition_types">history API</a> describing how the browser 135 href="history.html#transition_types">history API</a> describing how the browser
113 navigated to this particular URL. In addition, several <em>transition 136 navigated to this particular URL. In addition, several <em>transition
114 qualifiers</em> can be returned that further define the navigation. 137 qualifiers</em> can be returned that further define the navigation.
115 </p> 138 </p>
116 <p> 139 <p>
(...skipping 25 matching lines...) Expand all
142 </tr> 165 </tr>
143 <tr> 166 <tr>
144 <td>"from_address_bar"</td> 167 <td>"from_address_bar"</td>
145 <td> 168 <td>
146 The user initiated the navigation from the address bar (aka Omnibox). 169 The user initiated the navigation from the address bar (aka Omnibox).
147 </td> 170 </td>
148 </tr> 171 </tr>
149 </table> 172 </table>
150 173
151 <!-- END AUTHORED CONTENT --> 174 <!-- END AUTHORED CONTENT -->
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698