summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/docs/static/tabs.html
blob: 24c81494e6512611445e8c38c2693d2934e87ac2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<div id="pageData-name" class="pageData">Tabs</div>

<!-- BEGIN AUTHORED CONTENT -->
<p id="classSummary">
Use the <code>chrome.tabs</code> module
to interact with the browser's tab system.
You can use this module to
create, modify, and rearrange tabs in the browser.
</p>

<img src="images/tabs.png"
     width="323" height="50" alt="Two tabs in a window" />

<h2 id="manifest">Manifest</h2>
<p>
Almost all <code>chrome.tabs</code> methods require you to
declare the "tabs" permission
in the <a href="manifest.html">extension manifest</a>.
For example:
</p>

<pre>{
  "name": "My extension",
  ...
  <b>"permissions": [
    "tabs"
  ]</b>,
  ...
}</pre>

<p>
Three methods (<a href="#method-create"><code>create</code></a>,
<a href="#method-update"><code>update</code></a> and
<a href="#method-remove"><code>remove</code></a>) and one event
(<a href="#event-onRemoved"><code>onRemoved</code></a>) don't require the "tabs"
permission.
</p>


<h2 id="examples"> 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/tabs/">examples/api/tabs</a>
directory.
For other examples and for help in viewing the source code, see
<a href="samples.html">Samples</a>.
</p>

<!-- END AUTHORED CONTENT -->