| Index: chrome/common/extensions/docs/server2/templates/intros/webNavigation.html
|
| diff --git a/chrome/common/extensions/docs/server2/templates/intros/webNavigation.html b/chrome/common/extensions/docs/server2/templates/intros/webNavigation.html
|
| index 063693f2e155601ec35b318e519ca4563a37ec42..20afd95944f782bde83a7f6e54e1b87f7b11a663 100644
|
| --- a/chrome/common/extensions/docs/server2/templates/intros/webNavigation.html
|
| +++ b/chrome/common/extensions/docs/server2/templates/intros/webNavigation.html
|
| @@ -1,8 +1,8 @@
|
| -<!-- BEGIN AUTHORED CONTENT -->
|
| <p id="classSummary">
|
| Use the <code>chrome.webNavigation</code> module to receive
|
| notifications about the status of navigations requests in-flight.
|
| </p>
|
| +
|
| <h2>Manifest</h2>
|
| <p>
|
| All <code>chrome.webNavigation</code> methods and events require you to declare
|
| @@ -10,6 +10,7 @@ the "webNavigation" permission in the <a href="manifest.html">extension
|
| manifest</a>.
|
| For example:
|
| </p>
|
| +
|
| <pre>{
|
| "name": "My extension",
|
| ...
|
| @@ -18,7 +19,10 @@ For example:
|
| ]</b>,
|
| ...
|
| }</pre>
|
| +
|
| +
|
| <h2>Examples</h2>
|
| +
|
| <p>
|
| You can find simple examples of using the tabs module in the
|
| <a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/examples/api/webNavigation/">examples/api/webNavigation</a>
|
| @@ -26,6 +30,7 @@ directory.
|
| For other examples and for help in viewing the source code, see
|
| <a href="samples.html">Samples</a>.
|
| </p>
|
| +
|
| <h2>Event order</h2>
|
| <p>
|
| For a navigation that is successfully completed, events are fired in the
|
| @@ -51,6 +56,20 @@ If the reference fragment of a frame is changed, a
|
| time after <code>onDOMContentLoaded</code>, even after
|
| <code>onCompleted</code>.
|
| </p>
|
| +<p>
|
| +If the history API is used to modify the state of a frame (e.g. using
|
| +<code>history.pushState()</code>, a <code>onHistoryStateUpdated</code> event is
|
| +fired. This event can fire any time after <code>onDOMContentLoaded</code>.
|
| +</p>
|
| +<p>
|
| +If a navigation was triggered via <a
|
| +href="https://support.google.com/chrome/bin/answer.py?answer=177873">Chrome
|
| +Instant</a> or <a
|
| +href="https://support.google.com/chrome/bin/answer.py?answer=1385029">Instant
|
| +Pages</a>, a completely loaded page is swapped into the current tab. In that
|
| +case, an <code>onTabReplaced</code> event is fired.
|
| +</p>
|
| +
|
| <h2>Relation to webRequest events</h2>
|
| <p>
|
| There is no defined ordering between events of the <a
|
| @@ -64,6 +83,17 @@ In general, the webNavigation events are closely related to the navigation
|
| state that is displayed in the UI, while the webRequest events correspond to
|
| the state of the network stack which is generally opaque to the user.
|
| </p>
|
| +
|
| +<h2>A note about tab IDs</h2>
|
| +<p>
|
| +Not all navigating tabs correspond to actual tabs in Chrome's UI, e.g., a tab
|
| +that is being pre-rendered. Such tabs are not accessible via the
|
| +<a href="tabs.html">tabs API</a> nor can you request information about them via
|
| +<code>webNavigation.getFrame</code> or <code>webNavigation.getAllFrames</code>.
|
| +Once such a tab is swapped in, an <code>onTabReplaced</code> event is fired and
|
| +they become accessible via these APIs.
|
| +</p>
|
| +
|
| <h2>A note about timestamps</h2>
|
| <p>
|
| It's important to note that some technical oddities in the OS's handling
|
| @@ -75,6 +105,25 @@ offset between them, but comparing them to the current time inside the
|
| extension (via <code>(new Date()).getTime()</code>, for instance) might give
|
| unexpected results.
|
| </p>
|
| +
|
| +<h2>A note about frame and process IDs</h2>
|
| +<p>
|
| +Due to the multi-process nature of Chrome, a tab might use different processes
|
| +to render the source and destination of a web page. Therefore, if a navigation
|
| +takes place in a new process, you might receive events both from the new and
|
| +the old page until the new navigation is committed (i.e. the
|
| +<code>onCommitted</code> event is send for the new main frame). Because frame
|
| +IDs are only unique for a given process, the webNavigation events include a
|
| +process ID, so you can still determine which frame a navigation came from.
|
| +</p>
|
| +<p>
|
| +Also note that during a provisional load the process might be switched several
|
| +times. This happens when the load is redirected to a different site. In this
|
| +case, you will receive repeated <code>onBeforeNavigate</code> and
|
| +<code>onErrorOccurred</code> events, until you receive the final
|
| +<code>onCommitted</code> event.
|
| +</p>
|
| +
|
| <h2>Transition types and qualifiers</h2>
|
| <p>
|
| The webNavigation API's <code>onCommitted</code> event has a
|
| @@ -117,5 +166,4 @@ The following transition qualifiers exist:
|
| The user initiated the navigation from the address bar (aka Omnibox).
|
| </td>
|
| </tr>
|
| -</table>
|
| -<!-- END AUTHORED CONTENT -->
|
| +</table>
|
|
|