From 1239af15394f84827718c0c1327afd85c6bd1c22 Mon Sep 17 00:00:00 2001 From: "kathyw@chromium.org" Date: Fri, 16 Apr 2010 21:39:03 +0000 Subject: Document that you can override the Bookmark Manager page. Point to this from the chrome.bookmarks page. Besides adding Bookmark Manager info, I also reorganized things a bit and added the URL for each page. Is mentioning the URLs OK? (I've found them handy, but maybe we don't want to commit to them.) BUG=40806 TEST=none Review URL: http://codereview.chromium.org/1633017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44829 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/common/extensions/docs/bookmarks.html | 2 + chrome/common/extensions/docs/override.html | 94 ++++++++++++++-------- .../common/extensions/docs/static/bookmarks.html | 2 + chrome/common/extensions/docs/static/override.html | 92 +++++++++++++-------- 4 files changed, 123 insertions(+), 67 deletions(-) (limited to 'chrome/common/extensions/docs') diff --git a/chrome/common/extensions/docs/bookmarks.html b/chrome/common/extensions/docs/bookmarks.html index 011feeb..cb12c07 100644 --- a/chrome/common/extensions/docs/bookmarks.html +++ b/chrome/common/extensions/docs/bookmarks.html @@ -305,6 +305,8 @@

Use the chrome.bookmarks module to create, organize, and otherwise manipulate bookmarks. +Also see Override Pages, +which you can use to create a custom Bookmark Manager page.

Clicking the star adds a bookmark diff --git a/chrome/common/extensions/docs/override.html b/chrome/common/extensions/docs/override.html index e6dd31b..07b5724 100644 --- a/chrome/common/extensions/docs/override.html +++ b/chrome/common/extensions/docs/override.html @@ -289,24 +289,52 @@
true

-Override pages are a way to replace a page -that Google Chrome provides -with an HTML file that your extension provides. -An override page usually has CSS and JavaScript code, -in addition to HTML. A single extension can only override -one page. +Override pages are a way to substitute an HTML file from your extension +for a page that Google Chrome normally provides. +In addition to HTML, +an override page usually has CSS and JavaScript code.

-Currently, extensions can replace two pages: +An extension can replace any one of the following pages:

+ +

+Note: +A single extension can override +only one page. +

+ +

+The following screenshots show the default New Tab page +next to a custom New Tab page. +

+ @@ -325,58 +353,56 @@ Currently, extensions can replace two pages:

Manifest

-Register override pages in the -extension manifest -using property chrome_url_overrides. For example, the new tabs page can be overridden like this: +Register an override page in the +extension manifest like this:

{
   "name": "My extension",
   ...
-  "chrome_url_overrides": {
-    "newtab": "newtab.html"
+
+  "chrome_url_overrides" : {
+    "pageToOverride": "myPage.html"
   },
   ...
 }
-You can override the history page like this: +

+For pageToOverride, substitute one of the following: +

-
{
-  "name": "My extension",
-  ...
-  "chrome_url_overrides": {
-    "history": "history.html"
-  },
-  ...
-}
+ -A single extension may only override one page.

Tips

-For an effective override pages, follow these guidelines: +For an effective override page, follow these guidelines:

The default New Tab page
@@ -62,57 +90,55 @@ Currently, extensions can replace two pages:

Manifest

-Register override pages in the -extension manifest -using property chrome_url_overrides. For example, the new tabs page can be overridden like this: +Register an override page in the +extension manifest like this:

{
   "name": "My extension",
   ...
-  "chrome_url_overrides": {
-    "newtab": "newtab.html"
+
+  "chrome_url_overrides" : {
+    "pageToOverride": "myPage.html"
   },
   ...
 }
-You can override the history page like this: +

+For pageToOverride, substitute one of the following: +

-
{
-  "name": "My extension",
-  ...
-  "chrome_url_overrides": {
-    "history": "history.html"
-  },
-  ...
-}
+
    +
  • bookmarks +
  • history +
  • newtab +
-A single extension may only override one page.

Tips

-For an effective override pages, follow these guidelines: +For an effective override page, follow these guidelines:

  • Make your page quick and small.
    - Users expect built in browser pages to open instantly. Avoid doing things that - may take a long time. + Users expect built-in browser pages to open instantly. + Avoid doing things that might take a long time. For example, avoid synchronous fetches of network or database resources.

  • Include a title in your page.
    - Otherwise people will see the URL of the page, - which might confuse them. + Otherwise people might see the URL of the page, + which could be confusing. Here's an example of specifying the title: <title>New Tab</title>

    - +
  • Don't rely on the page having the keyboard focus.
    @@ -122,7 +148,7 @@ For an effective override pages, follow these guidelines:

  • - Don't try to emulate the default pages.
    + Don't try to emulate the default New Tab page.
    The APIs necessary to create a slightly modified version of the default New Tab page — with top pages, -- cgit v1.1

The default New Tab page