OLD | NEW |
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 Loading... |
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 |
112 </p> | 112 frame (across multiple navigations). |
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> | 113 </p> |
122 <p> | 114 <p> |
123 Also note that during a provisional load the process might be switched several | 115 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 | 116 times. This happens when the load is redirected to a different site. In this |
125 case, you will receive repeated <code>onBeforeNavigate</code> and | 117 case, you will receive repeated <code>onBeforeNavigate</code> and |
126 <code>onErrorOccurred</code> events, until you receive the final | 118 <code>onErrorOccurred</code> events, until you receive the final |
127 <code>onCommitted</code> event. | 119 <code>onCommitted</code> event. |
128 </p> | 120 </p> |
129 | 121 |
130 <h2 id="transition_types">Transition types and qualifiers</h2> | 122 <h2 id="transition_types">Transition types and qualifiers</h2> |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 The user used the Forward or Back button to initiate the navigation. | 155 The user used the Forward or Back button to initiate the navigation. |
164 </td> | 156 </td> |
165 </tr> | 157 </tr> |
166 <tr> | 158 <tr> |
167 <td>"from_address_bar"</td> | 159 <td>"from_address_bar"</td> |
168 <td> | 160 <td> |
169 The user initiated the navigation from the address bar (aka Omnibox). | 161 The user initiated the navigation from the address bar (aka Omnibox). |
170 </td> | 162 </td> |
171 </tr> | 163 </tr> |
172 </table> | 164 </table> |
OLD | NEW |