1 <h2 id=
"manifest">Manifest
</h2>
3 When requested, a
<code>$(ref:windows.Window)
</code>
4 will contain an array of
<code>$(ref:tabs.Tab)
</code> objects.
6 You must declare the
<code>"tabs"</code> permission in your
7 <a href=
"manifest">manifest
</a> if you require access to the
8 <code>$(ref:tabs.Tab.url url)
</code>,
9 <code>$(ref:tabs.Tab.title title)
</code>, or
10 <code>$(ref:tabs.Tab.favIconUrl favIconUrl)
</code> properties of
11 <code>$(ref:tabs.Tab)
</code>.
15 <pre data-filename=
"manifest.json">
17 "name":
"My extension",
19 <b>"permissions": [
"tabs"]
</b>,
24 <h2 id=
"current-window">The current window
</h2>
26 <p>Many functions in the extension system
27 take an optional
<var>windowId
</var> parameter,
28 which defaults to the current window.
31 <p>The
<em>current window
</em> is the window that
32 contains the code that is currently executing.
33 It's important to realize that this can be
34 different from the topmost or focused window.
37 <p>For example, say an extension
38 creates a few tabs or windows from a single HTML file,
39 and that the HTML file
42 The current window is the window that contains the page that made
43 the call, no matter what the topmost window is.
46 <p>In the case of the
<a href=
"event_pages">event page
</a>,
47 the value of the current window falls back to the last active window. Under some
48 circumstances, there may be no current window for background pages.
51 <h2 id=
"examples"> Examples
</h2>
54 <img src=
"{{static}}/images/windows.png"
55 width=
"561" height=
"224" alt=
"Two windows, each with one tab" />
57 You can find simple examples of using the windows module in the
58 <a href=
"http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/examples/api/windows/">examples/api/windows
</a>
60 Another example is in the
61 <a href=
"http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/examples/api/tabs/inspector/tabs_api.html?content-type=text/plain">tabs_api.html
</a> file
63 <a href=
"http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/examples/api/tabs/inspector/">inspector
</a>
65 For other examples and for help in viewing the source code, see
66 <a href=
"samples">Samples
</a>.