1 <h1>Override Pages
</h1>
25 Override pages are a way to substitute an HTML file from your extension
26 for a page that Google Chrome normally provides.
28 an override page usually has CSS and JavaScript code.
32 An extension can replace any one of the following pages:
34 <li> <b>Bookmark Manager:
</b>
35 The page that appears when the user chooses
36 the Bookmark Manager menu item
37 from the Chrome menu or, on Mac,
38 the Bookmark Manager item from the Bookmarks menu.
39 You can also get to this page by entering the URL
40 <b>chrome://bookmarks
</b>.
44 The page that appears when the user
45 chooses the History menu item
46 from the Chrome menu or, on Mac,
47 the Show Full History item from the History menu.
48 You can also get to this page by entering the URL
49 <b>chrome://history
</b>.
53 The page that appears when the user creates a new tab or window.
54 You can also get to this page by entering the URL
55 <b>chrome://newtab
</b>.
62 A single extension can override
64 For example, an extension can't override both
65 the Bookmark Manager and History pages.
69 Incognito windows are treated specially.
70 New Tab pages cannot be overridden in incognito windows.
71 Other override pages work in incognito windows
73 <a href=
"manifest/incognito">incognito
</a>
74 manifest property is set to
"spanning"
75 (which is the default value).
76 See
<a href=
"overview#incognito">Saving data and incognito mode
</a>
77 in the Overview for more details on how you should treat
82 The following screenshots show the default New Tab page
83 next to a custom New Tab page.
88 <td> <b>The default New Tab page
</b> </td>
89 <td> <b>An alternative New Tab page
</b> </td>
93 <img src=
"{{static}}/images/ntp-default.png"
94 alt=
"default New Tab page"
95 width=
"200" height=
"173">
98 <img src=
"{{static}}/images/ntp-blank.png"
99 alt=
"a blank New Tab page"
100 width=
"200" height=
"173">
105 <h2 id=
"manifest">Manifest
</h2>
108 Register an override page in the
109 <a href=
"manifest">extension manifest
</a> like this:
113 "name":
"My extension",
116 <b> "chrome_url_overrides" : {
117 "<em>pageToOverride</em>":
"<em>myPage.html</em>"
123 For
<code><em>pageToOverride
</em></code>, substitute one of the following:
127 <li> <code>bookmarks
</code>
128 <li> <code>history
</code>
129 <li> <code>newtab
</code>
133 <h2 id=
"tips">Tips
</h2>
136 For an effective override page, follow these guidelines:
142 <b>Make your page quick and small.
</b> <br />
143 Users expect built-in browser pages to open instantly.
144 Avoid doing things that might take a long time.
145 For example, avoid synchronous fetches of network or database resources.
150 <b>Include a title in your page.
</b> <br />
151 Otherwise people might see the URL of the page,
152 which could be confusing.
153 Here's an example of specifying the title:
154 <code><title
>New
Tab
</title
></code>
159 <b>Don't rely on the page having the keyboard focus.
</b> <br />
160 The address bar always gets the focus first
161 when the user creates a new tab.
166 <b>Don't try to emulate the default New Tab page.
</b> <br />
167 The APIs necessary to create
168 a slightly modified version of the default New Tab page
—
170 recently closed pages,
172 a theme background image,
176 you're better off trying to make something completely different.
181 <h2 id=
"examples"> Examples
</h2>
185 <!-- TODO(vasilii): Fix broken link. -->
186 <a href=
"samples#search:chrome_url_overrides">override samples
</a>.