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

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

Issue 1413543005: Use FrameTreeNode ID as frameId in extension APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Vend frameIds at 1 location; minimize thread hops for webRequest Created 5 years 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
OLDNEW
1 <h2 id="manifest">Manifest</h2> 1 <h2 id="manifest">Manifest</h2>
2 <p> 2 <p>
3 All <code>chrome.webNavigation</code> methods and events require you to declare 3 All <code>chrome.webNavigation</code> methods and events require you to declare
4 the "webNavigation" permission in the <a href="manifest">extension 4 the "webNavigation" permission in the <a href="manifest">extension
5 manifest</a>. 5 manifest</a>.
6 For example: 6 For example:
7 </p> 7 </p>
8 8
9 <pre data-filename="manifest.json"> 9 <pre data-filename="manifest.json">
10 { 10 {
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 It's important to note that some technical oddities in the OS's handling 96 It's important to note that some technical oddities in the OS's handling
97 of distinct Chrome processes can cause the clock to be skewed between the 97 of distinct Chrome processes can cause the clock to be skewed between the
98 browser itself and extension processes. That means that WebNavigation's events' 98 browser itself and extension processes. That means that WebNavigation's events'
99 <code>timeStamp</code> property is only guaranteed to be <i>internally</i> 99 <code>timeStamp</code> property is only guaranteed to be <i>internally</i>
100 consistent. Comparing one event to another event will give you the correct 100 consistent. Comparing one event to another event will give you the correct
101 offset between them, but comparing them to the current time inside the 101 offset between them, but comparing them to the current time inside the
102 extension (via <code>(new Date()).getTime()</code>, for instance) might give 102 extension (via <code>(new Date()).getTime()</code>, for instance) might give
103 unexpected results. 103 unexpected results.
104 </p> 104 </p>
105 105
106 <h2 id="frame_ids">A note about frame and process IDs</h2> 106 <h2 id="frame_ids">A note about frame IDs</h2>
107 <p> 107 <p>
108 Frames within a tab can be identified by a frame ID. The frame ID of the main 108 Frames within a tab can be identified by a frame ID. The frame ID of the main
109 frame is always 0, the ID of child frames is a positive number. Once a document 109 frame is always 0, the ID of child frames is a positive number. Once a document
110 is constructed in a frame, its frame ID remains constant during the lifetime of 110 is constructed in a frame, its frame ID remains constant during the lifetime of
111 the document. 111 the document. As of Chrome 48, this ID is also constant for the lifetime of the
Devlin 2015/12/10 21:53:06 Chrome 49?
robwu 2015/12/11 00:53:47 Done.
112 frame (across multiple navigations).
112 </p> 113 </p>
113 <p> 114 <p>
114 Due to the multi-process nature of Chrome, a tab might use different processes 115 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 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 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 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 <code>onCommitted</code> event is send for the new main frame). In other words,
119 IDs are only unique for a given process, the webNavigation events include a 120 it is possible to have more than one pending sequence of webNavigation events
120 process ID, so you can still determine which frame a navigation came from. 121 with the same <code>frameId</code>. The sequences can be distinguished by the
122 <code>processId</code> key.
121 </p> 123 </p>
122 <p> 124 <p>
123 Also note that during a provisional load the process might be switched several 125 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 126 times. This happens when the load is redirected to a different site. In this
125 case, you will receive repeated <code>onBeforeNavigate</code> and 127 case, you will receive repeated <code>onBeforeNavigate</code> and
126 <code>onErrorOccurred</code> events, until you receive the final 128 <code>onErrorOccurred</code> events, until you receive the final
127 <code>onCommitted</code> event. 129 <code>onCommitted</code> event.
128 </p> 130 </p>
129 131
130 <h2 id="transition_types">Transition types and qualifiers</h2> 132 <h2 id="transition_types">Transition types and qualifiers</h2>
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 The user used the Forward or Back button to initiate the navigation. 165 The user used the Forward or Back button to initiate the navigation.
164 </td> 166 </td>
165 </tr> 167 </tr>
166 <tr> 168 <tr>
167 <td>"from_address_bar"</td> 169 <td>"from_address_bar"</td>
168 <td> 170 <td>
169 The user initiated the navigation from the address bar (aka Omnibox). 171 The user initiated the navigation from the address bar (aka Omnibox).
170 </td> 172 </td>
171 </tr> 173 </tr>
172 </table> 174 </table>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698