summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-18 03:38:04 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-18 03:38:04 +0000
commitb21eccec94110c0a9a8ee90df148d4030350f60b (patch)
treedff2a825d25674302100bbb032103ffe721e2df8
parenta6f66bf26ec3118c12710b3bdd325a53e69d1da1 (diff)
downloadchromium_src-b21eccec94110c0a9a8ee90df148d4030350f60b.zip
chromium_src-b21eccec94110c0a9a8ee90df148d4030350f60b.tar.gz
chromium_src-b21eccec94110c0a9a8ee90df148d4030350f60b.tar.bz2
Revert 101678 (turned linux "sizes" step red, and noone was around to
confirm if that's expected.) - Description and Demo: https://sites.google.com/a/chromium.org/dev/developers/design-documents/extensions/offscreen-tabs Presentation: https://docs.google.com/a/google.com/present/view?id=dgjqt449_3gxsnm3qj Spec: http://www.corp.google.com/~alexbost/no_crawl/docs/experimental.offscreenTabs.html Review URL: http://codereview.chromium.org/7720002 TBR=alexbost@google.com Review URL: http://codereview.chromium.org/7931016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101685 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/extensions/extension_function_dispatcher.cc11
-rw-r--r--chrome/browser/extensions/extension_offscreen_tabs_apitest.cc20
-rw-r--r--chrome/browser/extensions/extension_offscreen_tabs_module.cc1228
-rw-r--r--chrome/browser/extensions/extension_offscreen_tabs_module.h156
-rw-r--r--chrome/browser/extensions/extension_offscreen_tabs_module_constants.cc78
-rw-r--r--chrome/browser/extensions/extension_offscreen_tabs_module_constants.h83
-rw-r--r--chrome/chrome_browser.gypi4
-rw-r--r--chrome/chrome_tests.gypi1
-rw-r--r--chrome/common/extensions/api/extension_api.json336
-rw-r--r--chrome/common/extensions/docs/experimental.html1
-rw-r--r--chrome/common/extensions/docs/experimental.offscreenTabs.html4028
-rw-r--r--chrome/common/extensions/docs/samples.json13
-rw-r--r--chrome/renderer/resources/extension_process_bindings.js18
-rw-r--r--chrome/renderer/resources/renderer_extension_bindings.js1
-rw-r--r--chrome/test/data/extensions/api_test/offscreen_tabs/a.html16
-rw-r--r--chrome/test/data/extensions/api_test/offscreen_tabs/b.html13
-rw-r--r--chrome/test/data/extensions/api_test/offscreen_tabs/c.html11
-rw-r--r--chrome/test/data/extensions/api_test/offscreen_tabs/manifest.json10
-rw-r--r--chrome/test/data/extensions/api_test/offscreen_tabs/test.html1
-rw-r--r--chrome/test/data/extensions/api_test/offscreen_tabs/test.js364
20 files changed, 2 insertions, 6391 deletions
diff --git a/chrome/browser/extensions/extension_function_dispatcher.cc b/chrome/browser/extensions/extension_function_dispatcher.cc
index 0869b61..8501b79 100644
--- a/chrome/browser/extensions/extension_function_dispatcher.cc
+++ b/chrome/browser/extensions/extension_function_dispatcher.cc
@@ -32,7 +32,6 @@
#include "chrome/browser/extensions/extension_management_api.h"
#include "chrome/browser/extensions/extension_metrics_module.h"
#include "chrome/browser/extensions/extension_module.h"
-#include "chrome/browser/extensions/extension_offscreen_tabs_module.h"
#include "chrome/browser/extensions/extension_omnibox_api.h"
#include "chrome/browser/extensions/extension_page_actions_module.h"
#include "chrome/browser/extensions/extension_permissions_api.h"
@@ -448,16 +447,6 @@ void FactoryRegistry::ResetFunctions() {
RegisterFunction<DownloadsAcceptDangerFunction>();
RegisterFunction<DownloadsShowFunction>();
RegisterFunction<DownloadsDragFunction>();
-
- // Experimental Offscreen Tabs
- RegisterFunction<CreateOffscreenTabFunction>();
- RegisterFunction<GetOffscreenTabFunction>();
- RegisterFunction<GetAllOffscreenTabFunction>();
- RegisterFunction<RemoveOffscreenTabFunction>();
- RegisterFunction<SendKeyboardEventOffscreenTabFunction>();
- RegisterFunction<SendMouseEventOffscreenTabFunction>();
- RegisterFunction<ToDataUrlOffscreenTabFunction>();
- RegisterFunction<UpdateOffscreenTabFunction>();
}
void FactoryRegistry::GetAllNames(std::vector<std::string>* names) {
diff --git a/chrome/browser/extensions/extension_offscreen_tabs_apitest.cc b/chrome/browser/extensions/extension_offscreen_tabs_apitest.cc
deleted file mode 100644
index aad5f9e..0000000
--- a/chrome/browser/extensions/extension_offscreen_tabs_apitest.cc
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/command_line.h"
-#include "chrome/browser/extensions/extension_apitest.h"
-#include "chrome/common/chrome_switches.h"
-
-class ExperimentalApiTest : public ExtensionApiTest {
- public:
- void SetUpCommandLine(CommandLine* command_line) {
- ExtensionApiTest::SetUpCommandLine(command_line);
- command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis);
- }
-};
-
-IN_PROC_BROWSER_TEST_F(ExperimentalApiTest, OffscreenTabs) {
- ASSERT_TRUE(RunExtensionTest("offscreen_tabs")) << message_;
-}
-
diff --git a/chrome/browser/extensions/extension_offscreen_tabs_module.cc b/chrome/browser/extensions/extension_offscreen_tabs_module.cc
deleted file mode 100644
index 3b7b09e..0000000
--- a/chrome/browser/extensions/extension_offscreen_tabs_module.cc
+++ /dev/null
@@ -1,1228 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/extensions/extension_offscreen_tabs_module.h"
-
-#include <algorithm>
-#include <vector>
-
-#include "base/base64.h"
-#include "base/json/json_writer.h"
-#include "base/memory/ref_counted_memory.h"
-#include "base/stl_util.h"
-#include "base/string_number_conversions.h"
-#include "base/string_util.h"
-#include "base/values.h"
-#include "chrome/browser/extensions/extension_event_router.h"
-#include "chrome/browser/extensions/extension_function_dispatcher.h"
-#include "chrome/browser/extensions/extension_host.h"
-#include "chrome/browser/extensions/extension_message_service.h"
-#include "chrome/browser/extensions/extension_offscreen_tabs_module_constants.h"
-#include "chrome/browser/extensions/extension_service.h"
-#include "chrome/browser/extensions/extension_tabs_module.h"
-#include "chrome/browser/net/url_fixer_upper.h"
-#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_navigator.h"
-#include "chrome/browser/ui/browser_window.h"
-#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
-#include "chrome/browser/ui/window_sizer.h"
-#include "chrome/common/chrome_notification_types.h"
-#include "chrome/common/extensions/extension.h"
-#include "chrome/common/extensions/extension_error_utils.h"
-#include "chrome/common/extensions/extension_messages.h"
-#include "chrome/common/pref_names.h"
-#include "chrome/common/url_constants.h"
-#include "content/browser/renderer_host/backing_store.h"
-#include "content/browser/renderer_host/render_view_host.h"
-#include "content/browser/renderer_host/render_view_host_delegate.h"
-#include "content/browser/tab_contents/navigation_entry.h"
-#include "content/browser/tab_contents/tab_contents.h"
-#include "content/browser/tab_contents/tab_contents_view.h"
-#include "content/common/content_client.h"
-#include "content/common/notification_service.h"
-#include "skia/ext/image_operations.h"
-#include "skia/ext/platform_canvas.h"
-#include "third_party/skia/include/core/SkBitmap.h"
-#include "ui/gfx/codec/jpeg_codec.h"
-#include "ui/gfx/codec/png_codec.h"
-
-using WebKit::WebInputEvent;
-
-namespace keys = extension_offscreen_tabs_module_constants;
-
-namespace {
-
-class ParentTab;
-
-// Offscreen Tab ---------------------------------------------------------------
-
-// This class is responsible for the creation and destruction of offscreen tabs,
-// as well as dispatching an onUpdated event.
-class OffscreenTab : public NotificationObserver {
- public:
- OffscreenTab();
- virtual ~OffscreenTab();
- void Init(const GURL& url,
- const int width,
- const int height,
- Profile* profile,
- ParentTab* parent_tab);
-
- TabContentsWrapper* tab() { return tab_.get(); }
- TabContents* contents() { return tab_.get()->tab_contents(); }
- ParentTab* parent_tab() { return parent_tab_; }
- DictionaryValue* CreateValue(); // Creates an offscreen tab object returned
- // by the API methods.
- // The caller owns the returned value.
-
- void SetURL(const GURL& url);
- void SetSize(int width, int height);
-
- private:
- virtual void Observe(int type,
- const NotificationSource& source,
- const NotificationDetails& details) OVERRIDE;
-
- NotificationRegistrar registrar_;
-
- scoped_ptr<TabContentsWrapper> tab_; // TabContentsWrapper associated with
- // this offscreen tab.
- ParentTab* parent_tab_;
-
- DISALLOW_COPY_AND_ASSIGN(OffscreenTab);
-};
-
-typedef std::vector<OffscreenTab*> TabVector;
-typedef TabVector::iterator TabIterator;
-typedef TabVector::const_iterator ConstTabIterator;
-
-// ParentTab -------------------------------------------------------------------
-
-// Holds info about a tab that has spawned at least one offscreen tab.
-// Each ParentTab keeps track of its child offscreen tabs. The ParentTab is also
-// responsible for killing its children when it navigates away or gets closed.
-class ParentTab : public NotificationObserver {
- public:
- ParentTab();
- virtual ~ParentTab();
- void Init(TabContents* tab_contents, const std::string& extension_id);
-
- TabContentsWrapper* tab() { return tab_; }
- TabContents* contents() { return tab_->tab_contents(); }
- const TabVector& offscreen_tabs() { return offscreen_tabs_; }
- const std::string& extension_id() const { return extension_id_; }
-
- // Tab takes ownership of OffscreenTab.
- void AddOffscreenTab(OffscreenTab *tab);
- // This deletes the OffscreenTab.
- void RemoveOffscreenTab(OffscreenTab *tab);
-
- private:
- virtual void Observe(int type,
- const NotificationSource& source,
- const NotificationDetails& details) OVERRIDE;
-
- NotificationRegistrar registrar_;
-
- TabContentsWrapper* tab_; // TabContentsWrapper associated with this tab.
- TabVector offscreen_tabs_; // Offscreen tabs spawned by this tab.
- std::string extension_id_; // Id of the extension running in this tab.
-
- DISALLOW_COPY_AND_ASSIGN(ParentTab);
-};
-
-// Map -------------------------------------------------------------------------
-
-// This map keeps track of all tabs that are happy parents of offscreen tabs.
-class Map {
- public:
- Map();
- ~Map();
-
- // Gets an offscreen tab by ID.
- bool GetOffscreenTab(const int offscreen_tab_id,
- ExtensionFunctionDispatcher* dispatcher,
- Profile* profile,
- OffscreenTab** offscreen_tab,
- std::string* error_message);
- // Gets a parent tab by ID.
- bool GetParentTab(const int parent_tab_id,
- ParentTab** tab,
- std::string* error_message);
- // Creates a mapping between a parent tab and an offscreen tab.
- bool AddOffscreenTab(OffscreenTab* offscreen_tab,
- const GURL& url,
- const int width,
- const int height,
- Profile* profile,
- ExtensionFunctionDispatcher* dispatcher,
- const std::string& ext_id,
- std::string* error_message);
- // Removes the mapping between a parent tab and an offscreen tab.
- // May cause the Tab object associated with the parent to be deleted.
- bool RemoveOffscreenTab(const int offscreen_tab_id,
- ExtensionFunctionDispatcher* dispatcher,
- Profile* profile,
- std::string* error_message);
- // Removes a parent tab from the map along with its child offscreen tabs.
- // It is called by the destructor of a ParentTab.
- bool RemoveParentTab(const int parent_tab_id, std::string* error_message);
-
- private:
- typedef base::hash_map<int, ParentTab*> TabMap;
- TabMap map;
-
- DISALLOW_COPY_AND_ASSIGN(Map);
-};
-
-// Variables -------------------------------------------------------------------
-
-Map* map = NULL;
-
-// We are assuming that offscreen tabs will not be created by background pages
-// with the exception of the API test background page. We keep track of the
-// offscreen tabs associated with the test API background page via this variable
-// These tab contents are created just for convenience and do not do anything.
-// TODO(alexbost): Think about handling multiple background pages each spawning
-// offscreen tabs. Would background pages want to spawn offscreen tabs?
-// If not, we need to somehow distinguish between the test background page and
-// regular background pages and disallow offscreen tab creation for the latter.
-TabContents* background_page_tab_contents = NULL;
-
-// Util ------------------------------------------------------------------------
-
-// Gets the map of parent tabs to offscreen tabs.
-Map* GetMap() {
- if (map == NULL)
- map = new Map();
-
- return map;
-}
-
-// Gets the TabContents associated with the test API background page.
-TabContents* GetBackgroundPageTabContents(Profile* profile) {
- if (background_page_tab_contents == NULL) {
- background_page_tab_contents =
- new TabContents(profile, NULL, MSG_ROUTING_NONE, NULL, NULL);
- new TabContentsWrapper(background_page_tab_contents);
- }
-
- return background_page_tab_contents;
-}
-
-// Gets the contents of the tab that instantiated the extension API call.
-// In the case of background pages we use tab contents created by us.
-bool GetCurrentTabContents(ExtensionFunctionDispatcher* dispatcher,
- Profile* profile,
- TabContents** tab_contents,
- std::string* error_message) {
- *tab_contents = dispatcher->delegate()->GetAssociatedTabContents();
-
- // Background page (no associated tab contents).
- if (!*tab_contents)
- *tab_contents = GetBackgroundPageTabContents(profile);
-
- if (*tab_contents)
- return true;
-
- *error_message = keys::kCurrentTabNotFound;
- return false;
-}
-
-// TODO(alexbost): Needs refactoring. Similar method in extension_tabs_module.
-// Takes |url_string| and returns a GURL which is either valid and absolute
-// or invalid. If |url_string| is not directly interpretable as a valid (it is
-// likely a relative URL) an attempt is made to resolve it. |extension| is
-// provided so it can be resolved relative to its extension base
-// (chrome-extension://<id>/). Using the source frame url would be more correct,
-// but because the api shipped with urls resolved relative to their extension
-// base, we decided it wasn't worth breaking existing extensions to fix.
-GURL ResolvePossiblyRelativeURL(const std::string& url_string,
- const Extension* extension) {
- GURL url = GURL(url_string);
- if (!url.is_valid())
- url = extension->GetResourceURL(url_string);
-
- return url;
-}
-
-// TODO(alexbost): Needs refactoring. Similar method in extension_tabs_module.
-bool IsCrashURL(const GURL& url) {
- // Check a fixed-up URL, to normalize the scheme and parse hosts correctly.
- GURL fixed_url =
- URLFixerUpper::FixupURL(url.possibly_invalid_spec(), std::string());
- return (fixed_url.SchemeIs(chrome::kChromeUIScheme) &&
- (fixed_url.host() == chrome::kChromeUIBrowserCrashHost ||
- fixed_url.host() == chrome::kChromeUICrashHost));
-}
-
-// Offscreen Tab ---------------------------------------------------------------
-
-OffscreenTab::OffscreenTab()
- : parent_tab_(NULL) {
-}
-
-OffscreenTab::~OffscreenTab() {}
-
-void OffscreenTab::Init(const GURL& url,
- const int width,
- const int height,
- Profile* profile,
- ParentTab* parent_tab) {
- // Create the offscreen tab.
- TabContents* tab_contents = new TabContents(
- profile, NULL, MSG_ROUTING_NONE, NULL, NULL);
- tab_.reset(new TabContentsWrapper(tab_contents));
-
- SetSize(width, height); // Setting the size starts the renderer.
- SetURL(url);
- parent_tab_ = parent_tab;
-
- // Register for tab notifications.
- registrar_.Add(this,
- content::NOTIFICATION_NAV_ENTRY_COMMITTED,
- Source<NavigationController>(&contents()->controller()));
-}
-
-DictionaryValue* OffscreenTab::CreateValue() {
- DictionaryValue* result = new DictionaryValue();
-
- result->SetInteger(keys::kIdKey, ExtensionTabUtil::GetTabId(contents()));
- result->SetString(keys::kUrlKey, contents()->GetURL().spec());
- result->SetInteger(keys::kWidthKey,
- contents()->view()->GetContainerSize().width());
- result->SetInteger(keys::kHeightKey,
- contents()->view()->GetContainerSize().height());
-
- return result;
-}
-
-void OffscreenTab::SetURL(const GURL& url) {
- contents()->controller().LoadURL(
- url, GURL(), PageTransition::LINK, std::string());
-}
-
-void OffscreenTab::SetSize(int width, int height) {
- contents()->view()->SizeContents(gfx::Size(width, height));
-}
-
-void OffscreenTab::Observe(int type,
- const NotificationSource& source,
- const NotificationDetails& details) {
- DCHECK_EQ(content::NOTIFICATION_NAV_ENTRY_COMMITTED, type);
-
- DictionaryValue* changed_properties = new DictionaryValue();
- changed_properties->SetString(keys::kUrlKey, contents()->GetURL().spec());
-
- ListValue args;
- args.Append(
- Value::CreateIntegerValue(ExtensionTabUtil::GetTabId(contents())));
- args.Append(changed_properties);
- args.Append(CreateValue());
- std::string json_args;
- base::JSONWriter::Write(&args, false, &json_args);
-
- ListValue event_args;
- event_args.Set(0, Value::CreateStringValue(keys::kEventOnUpdated));
- event_args.Set(1, Value::CreateStringValue(json_args));
-
- // Dispatch an onUpdated event.
- // The primary use case for broadcasting the event is
- // when the offscreen tab is generated by a test API background page.
- if (parent_tab_->contents() == background_page_tab_contents) {
- Profile* profile = parent_tab_->tab()->profile();
- profile->GetExtensionEventRouter()->DispatchEventToRenderers(
- keys::kEventOnUpdated, json_args, profile, GURL());
- } else {
- // Send a routed event directly to the parent tab.
- if (parent_tab_->contents()->render_view_host() &&
- parent_tab_->contents()->render_view_host()->process())
- parent_tab_->contents()->render_view_host()->process()->Send(
- new ExtensionMsg_MessageInvoke(
- parent_tab_->contents()->render_view_host()->routing_id(),
- parent_tab_->extension_id(),
- keys::kDispatchEvent,
- event_args,
- GURL()));
- }
-}
-
-// ParentTab -------------------------------------------------------------------
-
-ParentTab::ParentTab()
- : tab_(NULL) {
-}
-
-ParentTab::~ParentTab() {
- // Kill child offscreen tabs.
- STLDeleteElements(&offscreen_tabs_);
-
- bool removed = GetMap()->RemoveParentTab(
- ExtensionTabUtil::GetTabId(contents()), new std::string());
- DCHECK(removed);
-}
-
-void ParentTab::Init(TabContents* tab_contents,
- const std::string& extension_id) {
- DCHECK(tab_contents);
-
- tab_ = TabContentsWrapper::GetCurrentWrapperForContents(tab_contents);
- DCHECK(tab_);
-
- extension_id_ = extension_id;
-
- // Register for tab notifications.
- registrar_.Add(this,
- content::NOTIFICATION_NAV_ENTRY_COMMITTED,
- Source<NavigationController>(&contents()->controller()));
-
- registrar_.Add(this,
- content::NOTIFICATION_TAB_CONTENTS_DESTROYED,
- Source<TabContents>(contents()));
-}
-
-void ParentTab::AddOffscreenTab(OffscreenTab *offscreen_tab) {
- offscreen_tabs_.push_back(offscreen_tab);
-}
-
-void ParentTab::RemoveOffscreenTab(OffscreenTab *offscreen_tab) {
- TabIterator it_tab = std::find(
- offscreen_tabs_.begin(), offscreen_tabs_.end(), offscreen_tab);
- offscreen_tabs_.erase(it_tab);
-
- delete offscreen_tab;
-}
-
-void ParentTab::Observe(int type,
- const NotificationSource& source,
- const NotificationDetails& details) {
- DCHECK(type == content::NOTIFICATION_NAV_ENTRY_COMMITTED ||
- type == content::NOTIFICATION_TAB_CONTENTS_DESTROYED);
-
- delete this;
-}
-
-// Map -------------------------------------------------------------------------
-
-Map::Map() {}
-Map::~Map() {}
-
-bool Map::GetOffscreenTab(const int offscreen_tab_id,
- ExtensionFunctionDispatcher* dispatcher,
- Profile* profile,
- OffscreenTab** offscreen_tab,
- std::string* error_message) {
- // Ensure that the current tab is the parent of the offscreen tab.
- TabContents* tab_contents = NULL;
- if (!GetCurrentTabContents(dispatcher, profile, &tab_contents, error_message))
- return false;
-
- ParentTab* parent_tab = NULL;
- if (!GetParentTab(
- ExtensionTabUtil::GetTabId(tab_contents), &parent_tab, error_message))
- return false;
-
- const TabVector& offscreen_tabs = parent_tab->offscreen_tabs();
-
- for (ConstTabIterator it = offscreen_tabs.begin();
- it != offscreen_tabs.end(); ++it) {
- if (ExtensionTabUtil::GetTabId((*it)->contents()) == offscreen_tab_id) {
- *offscreen_tab = *it;
- return true;
- }
- }
-
- *error_message = ExtensionErrorUtils::FormatErrorMessage(
- keys::kOffscreenTabNotFoundError, base::IntToString(offscreen_tab_id));
- return false;
-}
-
-bool Map::GetParentTab(const int parent_tab_id,
- ParentTab** parent_tab,
- std::string* error_message) {
- TabMap::iterator it = map.find(parent_tab_id);
-
- if (it == map.end()) {
- *error_message = ExtensionErrorUtils::FormatErrorMessage(
- keys::kTabNotFoundError, base::IntToString(parent_tab_id));
- return false;
- }
-
- *parent_tab = it->second;
-
- return true;
-}
-
-bool Map::AddOffscreenTab(OffscreenTab* offscreen_tab,
- const GURL& url,
- const int width,
- const int height,
- Profile* profile,
- ExtensionFunctionDispatcher* dispatcher,
- const std::string& ext_id,
- std::string* error_message) {
- // Get parent tab.
- TabContents* tab_contents = NULL;
- if (!GetCurrentTabContents(dispatcher, profile, &tab_contents, error_message))
- return false;
- int offscreen_tab_id = ExtensionTabUtil::GetTabId(tab_contents);
-
- ParentTab* parent_tab = NULL;
- if (!GetParentTab(offscreen_tab_id, &parent_tab, error_message)) {
- parent_tab = new ParentTab();
- parent_tab->Init(tab_contents, ext_id);
-
- map[offscreen_tab_id] = parent_tab;
- }
-
- offscreen_tab->Init(url, width, height, profile, parent_tab);
-
- // Add child to parent.
- parent_tab->AddOffscreenTab(offscreen_tab);
-
- return true;
-}
-
-bool Map::RemoveOffscreenTab(const int offscreen_tab_id,
- ExtensionFunctionDispatcher* dispatcher,
- Profile* profile,
- std::string* error_message) {
- OffscreenTab* offscreen_tab = NULL;
- if (!GetOffscreenTab(offscreen_tab_id, dispatcher, profile,
- &offscreen_tab, error_message))
- return false;
-
- ParentTab* parent_tab = offscreen_tab->parent_tab();
-
- parent_tab->RemoveOffscreenTab(offscreen_tab);
- offscreen_tab = NULL;
-
- // If this was the last offscreen tab for the parent tab, remove the parent.
- if (parent_tab->offscreen_tabs().empty())
- delete parent_tab; // Causes tab to be removed from the map!
-
- return true;
-}
-
-bool Map::RemoveParentTab(const int parent_tab_id, std::string* error_message) {
- if (map.find(parent_tab_id) == map.end()) {
- *error_message = ExtensionErrorUtils::FormatErrorMessage(
- keys::kTabNotFoundError, base::IntToString(parent_tab_id));
- return false;
- }
-
- map.erase(parent_tab_id);
-
- return true;
-}
-
-} // namespace
-
-// API functions ---------------------------------------------------------------
-
-// create ----------------------------------------------------------------------
-
-CreateOffscreenTabFunction::CreateOffscreenTabFunction() {}
-CreateOffscreenTabFunction::~CreateOffscreenTabFunction() {}
-
-bool CreateOffscreenTabFunction::RunImpl() {
- DictionaryValue* create_props;
- EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(0, &create_props));
-
- std::string url_string;
- GURL url;
- EXTENSION_FUNCTION_VALIDATE(
- create_props->GetString(keys::kUrlKey, &url_string));
- url = ResolvePossiblyRelativeURL(url_string, GetExtension());
- if (!url.is_valid()) {
- error_ = ExtensionErrorUtils::FormatErrorMessage(
- keys::kInvalidUrlError, url_string);
- return false;
- }
- if (IsCrashURL(url)) {
- error_ = keys::kNoCrashBrowserError;
- return false;
- }
-
- gfx::Rect window_bounds;
- bool maximized;
- if (!create_props->HasKey(keys::kWidthKey) ||
- !create_props->HasKey(keys::kHeightKey)) {
- Browser* browser = GetCurrentBrowser();
- if (!browser) {
- error_ = keys::kNoCurrentWindowError;
- return false;
- }
-
- WindowSizer::GetBrowserWindowBounds(std::string(), gfx::Rect(),
- browser, &window_bounds,
- &maximized);
- }
-
- int width = window_bounds.width();
- if (create_props->HasKey(keys::kWidthKey))
- EXTENSION_FUNCTION_VALIDATE(
- create_props->GetInteger(keys::kWidthKey, &width));
-
- int height = window_bounds.height();
- if (create_props->HasKey(keys::kHeightKey))
- EXTENSION_FUNCTION_VALIDATE(
- create_props->GetInteger(keys::kHeightKey, &height));
-
- OffscreenTab* offscreen_tab = new OffscreenTab();
-
- // Add the offscreen tab to the map so we don't lose track of it.
- if (!GetMap()->AddOffscreenTab(offscreen_tab, url, width, height, profile_,
- dispatcher(), extension_id(), &error_)) {
- delete offscreen_tab; // Prevent leaking of offscreen tab.
- return false;
- }
-
- // TODO(alexbost): Maybe the callback is called too soon. It should probably
- // be called once we have navigated to the url.
- if (has_callback()) {
- result_.reset(offscreen_tab->CreateValue());
- SendResponse(true);
- }
-
- return true;
-}
-
-// get -------------------------------------------------------------------------
-
-GetOffscreenTabFunction::GetOffscreenTabFunction() {}
-GetOffscreenTabFunction::~GetOffscreenTabFunction() {}
-
-bool GetOffscreenTabFunction::RunImpl() {
- int offscreen_tab_id;
- EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &offscreen_tab_id));
-
- OffscreenTab* offscreen_tab = NULL;
- if (!GetMap()->
- GetOffscreenTab(offscreen_tab_id, dispatcher(), profile_,
- &offscreen_tab, &error_)) {
- error_ = ExtensionErrorUtils::FormatErrorMessage(
- keys::kOffscreenTabNotFoundError, base::IntToString(offscreen_tab_id));
- return false;
- }
-
- if (has_callback()) {
- result_.reset(offscreen_tab->CreateValue());
- SendResponse(true);
- }
-
- return true;
-}
-
-// getAll ----------------------------------------------------------------------
-
-GetAllOffscreenTabFunction::GetAllOffscreenTabFunction() {}
-GetAllOffscreenTabFunction::~GetAllOffscreenTabFunction() {}
-
-bool GetAllOffscreenTabFunction::RunImpl() {
- TabContents* tab_contents = NULL;
- if (!GetCurrentTabContents(dispatcher(), profile_, &tab_contents, &error_))
- return false;
-
- ParentTab* parent_tab = NULL;
- if (!GetMap()->
- GetParentTab(ExtensionTabUtil::GetTabId(tab_contents),
- &parent_tab, &error_))
- return false;
-
- const TabVector& offscreen_tabs = parent_tab->offscreen_tabs();
-
- ListValue* tab_list = new ListValue();
- for (ConstTabIterator it_tab = offscreen_tabs.begin();
- it_tab != offscreen_tabs.end(); ++it_tab)
- tab_list->Append((*it_tab)->CreateValue());
-
- if (has_callback()) {
- result_.reset(tab_list);
- SendResponse(true);
- }
-
- return true;
-}
-
-// remove ----------------------------------------------------------------------
-
-RemoveOffscreenTabFunction::RemoveOffscreenTabFunction() {}
-RemoveOffscreenTabFunction::~RemoveOffscreenTabFunction() {}
-
-bool RemoveOffscreenTabFunction::RunImpl() {
- int offscreen_tab_id;
- EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &offscreen_tab_id));
-
- OffscreenTab* offscreen_tab = NULL;
- if (!GetMap()->GetOffscreenTab(offscreen_tab_id, dispatcher(), profile_,
- &offscreen_tab, &error_))
- return false;
-
- if (!GetMap()->RemoveOffscreenTab(offscreen_tab_id, dispatcher(), profile_,
- &error_))
- return false;
-
- return true;
-}
-
-// sendKeyboardEvent -----------------------------------------------------------
-
-SendKeyboardEventOffscreenTabFunction::
- SendKeyboardEventOffscreenTabFunction() {}
-SendKeyboardEventOffscreenTabFunction::
- ~SendKeyboardEventOffscreenTabFunction() {}
-
-bool SendKeyboardEventOffscreenTabFunction::RunImpl() {
- int offscreen_tab_id;
- EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &offscreen_tab_id));
-
- OffscreenTab* offscreen_tab = NULL;
- if (!GetMap()->GetOffscreenTab(offscreen_tab_id, dispatcher(), profile_,
- &offscreen_tab, &error_))
- return false;
-
- // JavaScript KeyboardEvent.
- DictionaryValue* js_keyboard_event = NULL;
- EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(1, &js_keyboard_event));
-
- NativeWebKeyboardEvent keyboard_event;
-
- std::string type;
- if (js_keyboard_event->HasKey(keys::kKeyboardEventTypeKey)) {
- EXTENSION_FUNCTION_VALIDATE(
- js_keyboard_event->GetString(keys::kKeyboardEventTypeKey, &type));
- } else {
- error_ = keys::kInvalidKeyboardEventObjectError;
- return false;
- }
-
- if (type.compare(keys::kKeyboardEventTypeValueKeypress) == 0) {
- keyboard_event.type = WebInputEvent::Char;
- } else if (type.compare(keys::kKeyboardEventTypeValueKeydown) == 0) {
- keyboard_event.type = WebInputEvent::KeyDown;
- } else if (type.compare(keys::kKeyboardEventTypeValueKeyup) == 0) {
- keyboard_event.type = WebInputEvent::KeyUp;
- } else {
- error_ = keys::kInvalidKeyboardEventObjectError;
- return false;
- }
-
- int key_code;
- if (js_keyboard_event->HasKey(keys::kKeyboardEventKeyCodeKey)) {
- EXTENSION_FUNCTION_VALIDATE(js_keyboard_event->
- GetInteger(keys::kKeyboardEventKeyCodeKey, &key_code));
- } else {
- error_ = keys::kInvalidKeyboardEventObjectError;
- return false;
- }
-
- keyboard_event.nativeKeyCode = key_code;
- keyboard_event.windowsKeyCode = key_code;
- keyboard_event.setKeyIdentifierFromWindowsKeyCode();
-
- // Keypress = type character
- if (type.compare(keys::kKeyboardEventTypeValueKeypress) == 0) {
- int char_code;
- if (js_keyboard_event->HasKey(keys::kKeyboardEventCharCodeKey)) {
- EXTENSION_FUNCTION_VALIDATE(js_keyboard_event->
- GetInteger(keys::kKeyboardEventCharCodeKey, &char_code));
- keyboard_event.text[0] = char_code;
- keyboard_event.unmodifiedText[0] = char_code;
- } else {
- error_ = keys::kInvalidKeyboardEventObjectError;
- return false;
- }
- }
-
- bool alt_key;
- if (js_keyboard_event->HasKey(keys::kKeyboardEventAltKeyKey))
- EXTENSION_FUNCTION_VALIDATE(js_keyboard_event->
- GetBoolean(keys::kKeyboardEventAltKeyKey, &alt_key));
- if (alt_key)
- keyboard_event.modifiers |= WebInputEvent::AltKey;
-
- bool ctrl_key;
- if (js_keyboard_event->HasKey(keys::kKeyboardEventCtrlKeyKey))
- EXTENSION_FUNCTION_VALIDATE(js_keyboard_event->
- GetBoolean(keys::kKeyboardEventCtrlKeyKey, &ctrl_key));
- if (ctrl_key)
- keyboard_event.modifiers |= WebInputEvent::ControlKey;
-
- bool meta_key = false;
- if (js_keyboard_event->HasKey(keys::kMouseEventMetaKeyKey))
- EXTENSION_FUNCTION_VALIDATE(js_keyboard_event->
- GetBoolean(keys::kMouseEventMetaKeyKey, &meta_key));
- if (meta_key)
- keyboard_event.modifiers |= WebInputEvent::MetaKey;
-
- bool shift_key;
- if (js_keyboard_event->HasKey(keys::kKeyboardEventShiftKeyKey))
- EXTENSION_FUNCTION_VALIDATE(js_keyboard_event->
- GetBoolean(keys::kKeyboardEventShiftKeyKey, &shift_key));
- if (shift_key)
- keyboard_event.modifiers |= WebInputEvent::ShiftKey;
-
- // Forward the event.
- offscreen_tab->contents()->render_view_host()->
- ForwardKeyboardEvent(keyboard_event);
-
- if (has_callback()) {
- result_.reset(offscreen_tab->CreateValue());
- SendResponse(true);
- }
-
- return true;
-}
-
-// sendMouseEvent --------------------------------------------------------------
-
-SendMouseEventOffscreenTabFunction::SendMouseEventOffscreenTabFunction() {}
-SendMouseEventOffscreenTabFunction::~SendMouseEventOffscreenTabFunction() {}
-
-bool SendMouseEventOffscreenTabFunction::RunImpl() {
- int offscreen_tab_id;
- EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &offscreen_tab_id));
-
- OffscreenTab* offscreen_tab = NULL;
- if (!GetMap()->GetOffscreenTab(offscreen_tab_id, dispatcher(), profile_,
- &offscreen_tab, &error_))
- return false;
-
- // JavaScript MouseEvent.
- DictionaryValue* js_mouse_event = NULL;
- EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(1, &js_mouse_event));
-
- std::string type;
- if (js_mouse_event->HasKey(keys::kMouseEventTypeKey)) {
- EXTENSION_FUNCTION_VALIDATE(
- js_mouse_event->GetString(keys::kMouseEventTypeKey, &type));
- } else {
- error_ = keys::kInvalidMouseEventObjectError;
- return false;
- }
-
- if (type.compare(keys::kMouseEventTypeValueMousewheel) == 0) {
- WebKit::WebMouseWheelEvent wheel_event;
-
- wheel_event.type = WebInputEvent::MouseWheel;
-
- if (js_mouse_event->HasKey(keys::kMouseEventWheelDeltaXKey) &&
- js_mouse_event->HasKey(keys::kMouseEventWheelDeltaYKey)) {
- int delta_x, delta_y;
- EXTENSION_FUNCTION_VALIDATE(js_mouse_event->
- GetInteger(keys::kMouseEventWheelDeltaXKey, &delta_x));
- EXTENSION_FUNCTION_VALIDATE(js_mouse_event->
- GetInteger(keys::kMouseEventWheelDeltaYKey, &delta_y));
- wheel_event.deltaX = delta_x;
- wheel_event.deltaY = delta_y;
- } else {
- error_ = keys::kInvalidMouseEventObjectError;
- return false;
- }
-
- // Forward the event.
- offscreen_tab->contents()->render_view_host()->
- ForwardWheelEvent(wheel_event);
- } else {
- WebKit::WebMouseEvent mouse_event;
-
- if (type.compare(keys::kMouseEventTypeValueMousedown) == 0 ||
- type.compare(keys::kMouseEventTypeValueClick) == 0) {
- mouse_event.type = WebKit::WebInputEvent::MouseDown;
- } else if (type.compare(keys::kMouseEventTypeValueMouseup) == 0) {
- mouse_event.type = WebKit::WebInputEvent::MouseUp;
- } else if (type.compare(keys::kMouseEventTypeValueMousemove) == 0) {
- mouse_event.type = WebKit::WebInputEvent::MouseMove;
- } else {
- error_ = keys::kInvalidMouseEventObjectError;
- return false;
- }
-
- int button;
- if (js_mouse_event->HasKey(keys::kMouseEventButtonKey)) {
- EXTENSION_FUNCTION_VALIDATE(
- js_mouse_event->GetInteger(keys::kMouseEventButtonKey, &button));
- } else {
- error_ = keys::kInvalidMouseEventObjectError;
- return false;
- }
-
- if (button == keys::kMouseEventButtonValueLeft) {
- mouse_event.button = WebKit::WebMouseEvent::ButtonLeft;
- } else if (button == keys::kMouseEventButtonValueMiddle) {
- mouse_event.button = WebKit::WebMouseEvent::ButtonMiddle;
- } else if (button == keys::kMouseEventButtonValueRight) {
- mouse_event.button = WebKit::WebMouseEvent::ButtonRight;
- } else {
- error_ = keys::kInvalidMouseEventObjectError;
- return false;
- }
-
- if (HasOptionalArgument(2) && HasOptionalArgument(3)) {
- EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(2, &mouse_event.x));
- EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(3, &mouse_event.y));
- } else {
- error_ = keys::kNoMouseCoordinatesError;
- return false;
- }
-
- bool alt_key = false;
- if (js_mouse_event->HasKey(keys::kMouseEventAltKeyKey))
- EXTENSION_FUNCTION_VALIDATE(js_mouse_event->
- GetBoolean(keys::kMouseEventAltKeyKey, &alt_key));
- if (alt_key)
- mouse_event.modifiers |= WebInputEvent::AltKey;
-
- bool ctrl_key = false;
- if (js_mouse_event->HasKey(keys::kMouseEventCtrlKeyKey))
- EXTENSION_FUNCTION_VALIDATE(js_mouse_event->
- GetBoolean(keys::kMouseEventCtrlKeyKey, &ctrl_key));
- if (ctrl_key)
- mouse_event.modifiers |= WebInputEvent::ControlKey;
-
- bool meta_key = false;
- if (js_mouse_event->HasKey(keys::kMouseEventMetaKeyKey))
- EXTENSION_FUNCTION_VALIDATE(js_mouse_event->
- GetBoolean(keys::kMouseEventMetaKeyKey, &meta_key));
- if (meta_key)
- mouse_event.modifiers |= WebInputEvent::MetaKey;
-
- bool shift_key = false;
- if (js_mouse_event->HasKey(keys::kMouseEventShiftKeyKey))
- EXTENSION_FUNCTION_VALIDATE(js_mouse_event->
- GetBoolean(keys::kMouseEventShiftKeyKey, &shift_key));
- if (shift_key)
- mouse_event.modifiers |= WebInputEvent::ShiftKey;
-
- mouse_event.clickCount = 1;
-
- // Forward the event.
- offscreen_tab->contents()->render_view_host()->
- ForwardMouseEvent(mouse_event);
-
- // If the event is a click,
- // fire a mouseup event in addition to the mousedown.
- if (type.compare(keys::kMouseEventTypeValueClick) == 0) {
- mouse_event.type = WebKit::WebInputEvent::MouseUp;
- offscreen_tab->contents()->render_view_host()->
- ForwardMouseEvent(mouse_event);
- }
- }
-
- if (has_callback()) {
- result_.reset(offscreen_tab->CreateValue());
- SendResponse(true);
- }
-
- return true;
-}
-
-// toDataUrl -------------------------------------------------------------------
-
-ToDataUrlOffscreenTabFunction::ToDataUrlOffscreenTabFunction() {}
-ToDataUrlOffscreenTabFunction::~ToDataUrlOffscreenTabFunction() {}
-
-// TODO(alexbost): Needs refactoring. Similar method in extension_tabs_module.
-// TODO(alexbost): We want to optimize this function in order to get more image
-// updates on the browser side. One improvement would be to implement another
-// hash map in order to get offscreen tabs in O(1).
-bool ToDataUrlOffscreenTabFunction::RunImpl() {
- int offscreen_tab_id;
- EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &offscreen_tab_id));
-
- OffscreenTab* offscreen_tab = NULL;
- if (!GetMap()->GetOffscreenTab(offscreen_tab_id, dispatcher(), profile_,
- &offscreen_tab, &error_))
- return false;
-
- image_format_ = FORMAT_JPEG; // Default format is JPEG.
- image_quality_ = kDefaultQuality; // Default quality setting.
-
- if (HasOptionalArgument(1)) {
- DictionaryValue* options;
- EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(1, &options));
-
- if (options->HasKey(keys::kFormatKey)) {
- std::string format;
- EXTENSION_FUNCTION_VALIDATE(
- options->GetString(keys::kFormatKey, &format));
-
- if (format == keys::kFormatValueJpeg) {
- image_format_ = FORMAT_JPEG;
- } else if (format == keys::kFormatValuePng) {
- image_format_ = FORMAT_PNG;
- } else {
- // Schema validation should make this unreachable.
- EXTENSION_FUNCTION_VALIDATE(0);
- }
- }
-
- if (options->HasKey(keys::kQualityKey)) {
- EXTENSION_FUNCTION_VALIDATE(
- options->GetInteger(keys::kQualityKey, &image_quality_));
- }
- }
-
- // captureVisibleTab() can return an image containing sensitive information
- // that the browser would otherwise protect. Ensure the extension has
- // permission to do this.
- if (!GetExtension()->
- CanCaptureVisiblePage(offscreen_tab->contents()->GetURL(), &error_))
- return false;
-
-// The backing store approach works on Linux but not on Mac.
-// TODO(alexbost): Test on Windows
-#if !defined(OS_MACOSX)
- RenderViewHost* render_view_host =
- offscreen_tab->contents()->render_view_host();
-
- // If a backing store is cached for the tab we want to capture,
- // and it can be copied into a bitmap, then use it to generate the image.
- BackingStore* backing_store = render_view_host->GetBackingStore(false);
- if (backing_store && CaptureSnapshotFromBackingStore(backing_store))
- return true;
-#endif
-
- // Ask the renderer for a snapshot of the tab.
- TabContentsWrapper* tab_wrapper = offscreen_tab->tab();
- tab_wrapper->CaptureSnapshot();
- registrar_.Add(this,
- chrome::NOTIFICATION_TAB_SNAPSHOT_TAKEN,
- Source<TabContentsWrapper>(tab_wrapper));
-
- AddRef(); // Balanced in ToDataUrlOffscreenTabFunction::Observe().
-
- return true;
-}
-
-// TODO(alexbost): Needs refactoring. Similar method in extension_tabs_module.
-// Build the image of a tab's contents out of a backing store.
-// This may fail if we can not copy a backing store into a bitmap.
-// For example, some uncommon X11 visual modes are not supported by
-// CopyFromBackingStore().
-bool ToDataUrlOffscreenTabFunction::CaptureSnapshotFromBackingStore(
- BackingStore* backing_store) {
-
- skia::PlatformCanvas temp_canvas;
- if (!backing_store->CopyFromBackingStore(gfx::Rect(backing_store->size()),
- &temp_canvas)) {
- return false;
- }
- VLOG(1) << "captureVisibleTab() got image from backing store.";
-
- SendResultFromBitmap(
- skia::GetTopDevice(temp_canvas)->accessBitmap(false));
- return true;
-}
-
-// TODO(alexbost): Needs refactoring. Similar method in extension_tabs_module.
-void ToDataUrlOffscreenTabFunction::Observe(int type,
- const NotificationSource& source,
- const NotificationDetails& details) {
- DCHECK(type == chrome::NOTIFICATION_TAB_SNAPSHOT_TAKEN);
-
- const SkBitmap *screen_capture = Details<const SkBitmap>(details).ptr();
- const bool error = screen_capture->empty();
-
- if (error) {
- error_ = keys::kInternalVisibleTabCaptureError;
- SendResponse(false);
- } else {
- VLOG(1) << "Got image from renderer.";
- SendResultFromBitmap(*screen_capture);
- }
-
- Release(); // Balanced in ToDataUrlOffscreenTabFunction::RunImpl().
-}
-
-// TODO(alexbost): Needs refactoring. Similar method in extension_tabs_module.
-// Turn a bitmap of the screen into an image, set that image as the result,
-// and call SendResponse().
-void ToDataUrlOffscreenTabFunction::SendResultFromBitmap(
- const SkBitmap& screen_capture) {
- std::vector<unsigned char> data;
- SkAutoLockPixels screen_capture_lock(screen_capture);
- bool encoded = false;
- std::string mime_type;
- switch (image_format_) {
- case FORMAT_JPEG:
- encoded = gfx::JPEGCodec::Encode(
- reinterpret_cast<unsigned char*>(screen_capture.getAddr32(0, 0)),
- gfx::JPEGCodec::FORMAT_SkBitmap,
- screen_capture.width(),
- screen_capture.height(),
- static_cast<int>(screen_capture.rowBytes()),
- image_quality_,
- &data);
- mime_type = keys::kMimeTypeJpeg;
- break;
- case FORMAT_PNG:
- encoded = gfx::PNGCodec::EncodeBGRASkBitmap(
- screen_capture,
- true, // Discard transparency.
- &data);
- mime_type = keys::kMimeTypePng;
- break;
- default:
- NOTREACHED() << "Invalid image format.";
- }
-
- if (!encoded) {
- error_ = keys::kInternalVisibleTabCaptureError;
- SendResponse(false);
- return;
- }
-
- std::string base64_result;
- base::StringPiece stream_as_string(
- reinterpret_cast<const char*>(vector_as_array(&data)), data.size());
-
- base::Base64Encode(stream_as_string, &base64_result);
- base64_result.insert(0, base::StringPrintf("data:%s;base64,",
- mime_type.c_str()));
- result_.reset(new StringValue(base64_result));
- SendResponse(true);
-}
-
-// update ----------------------------------------------------------------------
-
-UpdateOffscreenTabFunction::UpdateOffscreenTabFunction() {}
-UpdateOffscreenTabFunction::~UpdateOffscreenTabFunction() {}
-
-// TODO(alexbost): Needs refactoring. Similar method in extension_tabs_module.
-bool UpdateOffscreenTabFunction::RunImpl() {
- int offscreen_tab_id;
- EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &offscreen_tab_id));
-
- OffscreenTab* offscreen_tab = NULL;
- if (!GetMap()->GetOffscreenTab(offscreen_tab_id, dispatcher(), profile_,
- &offscreen_tab, &error_))
- return false;
-
- DictionaryValue* update_props;
- EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(1, &update_props));
-
- // Url
- if (update_props->HasKey(keys::kUrlKey)) {
- std::string url_string;
- GURL url;
- EXTENSION_FUNCTION_VALIDATE(
- update_props->GetString(keys::kUrlKey, &url_string));
- url = ResolvePossiblyRelativeURL(url_string, GetExtension());
- if (!url.is_valid()) {
- error_ = ExtensionErrorUtils::FormatErrorMessage(
- keys::kInvalidUrlError, url_string);
- return false;
- }
- if (IsCrashURL(url)) {
- error_ = keys::kNoCrashBrowserError;
- return false;
- }
-
- // JavaScript URLs can do the same kinds of things as cross-origin XHR, so
- // we need to check host permissions before allowing them.
- if (url.SchemeIs(chrome::kJavaScriptScheme)) {
- if (!GetExtension()->CanExecuteScriptOnPage(
- offscreen_tab->contents()->GetURL(), NULL, &error_)) {
- return false;
- }
-
- ExtensionMsg_ExecuteCode_Params params;
- params.request_id = request_id();
- params.extension_id = extension_id();
- params.is_javascript = true;
- params.code = url.path();
- params.all_frames = false;
- params.in_main_world = true;
-
- RenderViewHost* render_view_host =
- offscreen_tab->contents()->render_view_host();
- render_view_host->Send(
- new ExtensionMsg_ExecuteCode(render_view_host->routing_id(),
- params));
-
- Observe(offscreen_tab->contents());
- AddRef(); // balanced in Observe()
-
- return true;
- }
-
- offscreen_tab->SetURL(url);
-
- // The URL of a tab contents never actually changes to a JavaScript URL, so
- // this check only makes sense in other cases.
- if (!url.SchemeIs(chrome::kJavaScriptScheme))
- DCHECK_EQ(url.spec(), offscreen_tab->contents()->GetURL().spec());
- }
-
- // Width and height
- if (update_props->HasKey(keys::kWidthKey) ||
- update_props->HasKey(keys::kHeightKey)) {
- int width;
- if (update_props->HasKey(keys::kWidthKey))
- EXTENSION_FUNCTION_VALIDATE(
- update_props->GetInteger(keys::kWidthKey, &width));
- else
- offscreen_tab->contents()->view()->GetContainerSize().width();
-
- int height;
- if (update_props->HasKey(keys::kHeightKey))
- EXTENSION_FUNCTION_VALIDATE(
- update_props->GetInteger(keys::kHeightKey, &height));
- else
- offscreen_tab->contents()->view()->GetContainerSize().height();
-
- offscreen_tab->SetSize(width, height);
- }
-
- // Callback
- if (has_callback()) {
- result_.reset(offscreen_tab->CreateValue());
- SendResponse(true);
- }
-
- return true;
-}
-
-// TODO(alexbost): Needs refactoring. Similar method in extension_tabs_module.
-bool UpdateOffscreenTabFunction::OnMessageReceived(
- const IPC::Message& message) {
- if (message.type() != ExtensionHostMsg_ExecuteCodeFinished::ID)
- return false;
-
- int message_request_id;
- void* iter = NULL;
- if (!message.ReadInt(&iter, &message_request_id)) {
- NOTREACHED() << "malformed extension message";
- return true;
- }
-
- if (message_request_id != request_id())
- return false;
-
- IPC_BEGIN_MESSAGE_MAP(UpdateOffscreenTabFunction, message)
- IPC_MESSAGE_HANDLER(ExtensionHostMsg_ExecuteCodeFinished,
- OnExecuteCodeFinished)
- IPC_END_MESSAGE_MAP()
- return true;
-}
-
-// TODO(alexbost): Needs refactoring. Similar method in extension_tabs_module.
-void UpdateOffscreenTabFunction::
- OnExecuteCodeFinished(int request_id,
- bool success,
- const std::string& error) {
- if (!error.empty()) {
- DCHECK(!success);
- error_ = error;
- }
-
- SendResponse(success);
-
- Observe(NULL);
- Release(); // balanced in Execute()
-}
-
diff --git a/chrome/browser/extensions/extension_offscreen_tabs_module.h b/chrome/browser/extensions/extension_offscreen_tabs_module.h
deleted file mode 100644
index 37ffa5b..0000000
--- a/chrome/browser/extensions/extension_offscreen_tabs_module.h
+++ /dev/null
@@ -1,156 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_OFFSCREEN_TABS_MODULE_H__
-#define CHROME_BROWSER_EXTENSIONS_EXTENSION_OFFSCREEN_TABS_MODULE_H__
-#pragma once
-
-#include <string>
-
-#include "base/values.h"
-#include "chrome/browser/extensions/extension_function.h"
-#include "content/browser/tab_contents/tab_contents_observer.h"
-#include "content/common/notification_observer.h"
-#include "content/common/notification_registrar.h"
-
-class BackingStore;
-class SkBitmap;
-class TabContents;
-class TabContentsWrapper;
-
-namespace base {
-class DictionaryValue;
-class ListValue;
-}
-
-// Creates an offscreen tab and adds it to a map of tabs and their child
-// offscreen tabs.
-class CreateOffscreenTabFunction : public SyncExtensionFunction {
- public:
- CreateOffscreenTabFunction();
- virtual ~CreateOffscreenTabFunction();
- virtual bool RunImpl() OVERRIDE;
-
- private:
- DECLARE_EXTENSION_FUNCTION_NAME("experimental.offscreenTabs.create")
- DISALLOW_COPY_AND_ASSIGN(CreateOffscreenTabFunction);
-};
-
-// Gets info about an offscreen tab.
-class GetOffscreenTabFunction : public SyncExtensionFunction {
- public:
- GetOffscreenTabFunction();
- virtual ~GetOffscreenTabFunction();
- virtual bool RunImpl() OVERRIDE;
-
- private:
- DECLARE_EXTENSION_FUNCTION_NAME("experimental.offscreenTabs.get")
- DISALLOW_COPY_AND_ASSIGN(GetOffscreenTabFunction);
-};
-
-// Gets all offscreen tabs created by the tab that invoked this function.
-class GetAllOffscreenTabFunction : public SyncExtensionFunction {
- public:
- GetAllOffscreenTabFunction();
- virtual ~GetAllOffscreenTabFunction();
- virtual bool RunImpl() OVERRIDE;
-
- private:
- DECLARE_EXTENSION_FUNCTION_NAME("experimental.offscreenTabs.getAll")
- DISALLOW_COPY_AND_ASSIGN(GetAllOffscreenTabFunction);
-};
-
-// Removes an offscreen tab.
-class RemoveOffscreenTabFunction : public SyncExtensionFunction {
- public:
- RemoveOffscreenTabFunction();
- virtual ~RemoveOffscreenTabFunction();
- virtual bool RunImpl() OVERRIDE;
-
- private:
- DECLARE_EXTENSION_FUNCTION_NAME("experimental.offscreenTabs.remove")
- DISALLOW_COPY_AND_ASSIGN(RemoveOffscreenTabFunction);
-};
-
-// Synthesizes a keyboard event based on a passed-in JavaScript keyboard event.
-class SendKeyboardEventOffscreenTabFunction : public SyncExtensionFunction {
- public:
- SendKeyboardEventOffscreenTabFunction();
- virtual ~SendKeyboardEventOffscreenTabFunction();
- virtual bool RunImpl() OVERRIDE;
-
- private:
- DECLARE_EXTENSION_FUNCTION_NAME(
- "experimental.offscreenTabs.sendKeyboardEvent")
- DISALLOW_COPY_AND_ASSIGN(SendKeyboardEventOffscreenTabFunction);
-};
-
-// Synthesizes a mouse event based on a passed-in JavaScript mouse event.
-// Since only the application knows where the user clicks, x and y coordinates
-// need to be passed in as well in this case of click, mousedown, and mouseup.
-class SendMouseEventOffscreenTabFunction : public SyncExtensionFunction {
- public:
- SendMouseEventOffscreenTabFunction();
- virtual ~SendMouseEventOffscreenTabFunction();
- virtual bool RunImpl() OVERRIDE;
-
- private:
- DECLARE_EXTENSION_FUNCTION_NAME("experimental.offscreenTabs.sendMouseEvent")
- DISALLOW_COPY_AND_ASSIGN(SendMouseEventOffscreenTabFunction);
-};
-
-// Gets a snapshot of the offscreen tabs and returns it as a data URL.
-class ToDataUrlOffscreenTabFunction : public AsyncExtensionFunction,
- public NotificationObserver {
- public:
- ToDataUrlOffscreenTabFunction();
- virtual ~ToDataUrlOffscreenTabFunction();
- virtual bool RunImpl() OVERRIDE;
-
- private:
- enum ImageFormat {
- FORMAT_JPEG,
- FORMAT_PNG
- };
-
- // The default quality setting used when encoding jpegs.
- static const int kDefaultQuality = 90;
- virtual bool CaptureSnapshotFromBackingStore(BackingStore* backing_store);
- virtual void Observe(int type,
- const NotificationSource& source,
- const NotificationDetails& details) OVERRIDE;
- virtual void SendResultFromBitmap(const SkBitmap& screen_capture);
-
- NotificationRegistrar registrar_;
-
- // The format (JPEG vs PNG) of the resulting image. Set in RunImpl().
- ImageFormat image_format_;
-
- // Quality setting to use when encoding jpegs. Set in RunImpl().
- int image_quality_;
-
- DECLARE_EXTENSION_FUNCTION_NAME("experimental.offscreenTabs.toDataUrl")
- DISALLOW_COPY_AND_ASSIGN(ToDataUrlOffscreenTabFunction);
-};
-
-// Updates an offscreen tab.
-class UpdateOffscreenTabFunction : public AsyncExtensionFunction,
- public TabContentsObserver {
- public:
- UpdateOffscreenTabFunction();
- virtual ~UpdateOffscreenTabFunction();
- virtual bool RunImpl() OVERRIDE;
-
- private:
- virtual bool OnMessageReceived(const IPC::Message& message);
- void OnExecuteCodeFinished(int request_id,
- bool success,
- const std::string& error);
-
- DECLARE_EXTENSION_FUNCTION_NAME("experimental.offscreenTabs.update")
- DISALLOW_COPY_AND_ASSIGN(UpdateOffscreenTabFunction);
-};
-
-#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_OFFSCREEN_TABS_MODULE_H__
-
diff --git a/chrome/browser/extensions/extension_offscreen_tabs_module_constants.cc b/chrome/browser/extensions/extension_offscreen_tabs_module_constants.cc
deleted file mode 100644
index 1a6596d..0000000
--- a/chrome/browser/extensions/extension_offscreen_tabs_module_constants.cc
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/extensions/extension_offscreen_tabs_module_constants.h"
-
-namespace extension_offscreen_tabs_module_constants {
-
-// offscreen tab keys
-const char kIdKey[] = "id";
-const char kUrlKey[] = "url";
-const char kWidthKey[] = "width";
-const char kHeightKey[] = "height";
-
-// toDataUrl keys
-const char kFormatKey[] = "format";
-const char kQualityKey[] = "quality";
-
-// mouse keys
-const char kMouseEventTypeKey[] = "type";
-const char kMouseEventButtonKey[] = "button";
-const char kMouseEventWheelDeltaXKey[] = "wheelDeltaX";
-const char kMouseEventWheelDeltaYKey[] = "wheelDeltaY";
-const char kMouseEventAltKeyKey[] = "altKey";
-const char kMouseEventCtrlKeyKey[] = "ctrlKey";
-const char kMouseEventMetaKeyKey[] = "metaKey";
-const char kMouseEventShiftKeyKey[] = "shiftKey";
-
-// toDataUrl values
-const char kFormatValueJpeg[] = "jpeg";
-const char kFormatValuePng[] = "png";
-const char kMimeTypeJpeg[] = "image/jpeg";
-const char kMimeTypePng[] = "image/png";
-
-// mouse values
-const char kMouseEventTypeValueMousedown[] = "mousedown";
-const char kMouseEventTypeValueMouseup[] = "mouseup";
-const char kMouseEventTypeValueClick[] = "click";
-const char kMouseEventTypeValueMousemove[] = "mousemove";
-const char kMouseEventTypeValueMousewheel[] = "mousewheel";
-const int kMouseEventButtonValueLeft = 0;
-const int kMouseEventButtonValueMiddle = 1;
-const int kMouseEventButtonValueRight = 2;
-
-// keyboard keys
-const char kKeyboardEventTypeKey[] = "type";
-const char kKeyboardEventCharCodeKey[] = "charCode";
-const char kKeyboardEventKeyCodeKey[] = "keyCode";
-const char kKeyboardEventAltKeyKey[] = "altKey";
-const char kKeyboardEventCtrlKeyKey[] = "ctrlKey";
-const char kKeyboardEventShiftKeyKey[] = "shiftKey";
-
-// keyboard values
-const char kKeyboardEventTypeValueKeypress[] = "keypress";
-const char kKeyboardEventTypeValueKeydown[] = "keydown";
-const char kKeyboardEventTypeValueKeyup[] = "keyup";
-
-// events
-const char kDispatchEvent[] = "Event.dispatchJSON";
-const char kEventOnUpdated[] = "experimental.offscreenTabs.onUpdated";
-
-// errors
-const char kCurrentTabNotFound[] = "No current tab found";
-const char kInternalVisibleTabCaptureError[] =
- "Internal error while trying to capture visible region of the current tab";
-const char kInvalidKeyboardEventObjectError[] =
- "Invalid or unexpected KeyboardEvent object";
-const char kInvalidMouseEventObjectError[] =
- "Invalid or enexpected MouseEvent object";
-const char kInvalidUrlError[] = "Invalid url: \"*\".";
-const char kNoCrashBrowserError[] = "I'm sorry. I'm afraid I can't do that.";
-const char kNoCurrentWindowError[] = "No current window";
-const char kNoMouseCoordinatesError[] = "No mouse coordinates specified";
-const char kOffscreenTabNotFoundError[] = "No offscreen tab with id: *.";
-const char kTabNotFoundError[] = "No tab with id: *.";
-
-} // namespace extension_offscreen_tabs_module_constants
-
diff --git a/chrome/browser/extensions/extension_offscreen_tabs_module_constants.h b/chrome/browser/extensions/extension_offscreen_tabs_module_constants.h
deleted file mode 100644
index 1ae5200..0000000
--- a/chrome/browser/extensions/extension_offscreen_tabs_module_constants.h
+++ /dev/null
@@ -1,83 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Constants used for the Tabs API and the Windows API.
-
-#ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_OFFSCREEN_TABS_MODULE_CONSTANTS_H_
-#define CHROME_BROWSER_EXTENSIONS_EXTENSION_OFFSCREEN_TABS_MODULE_CONSTANTS_H_
-#pragma once
-
-namespace extension_offscreen_tabs_module_constants {
-
-// TODO(alexbost): Some of these should be refactored
-
-// offscreen tab keys
-extern const char kIdKey[];
-extern const char kUrlKey[];
-extern const char kWidthKey[];
-extern const char kHeightKey[];
-
-// toDataUrl keys
-extern const char kFormatKey[];
-extern const char kQualityKey[];
-
-// mouse keys
-extern const char kMouseEventTypeKey[];
-extern const char kMouseEventButtonKey[];
-extern const char kMouseEventWheelDeltaXKey[];
-extern const char kMouseEventWheelDeltaYKey[];
-extern const char kMouseEventAltKeyKey[];
-extern const char kMouseEventCtrlKeyKey[];
-extern const char kMouseEventMetaKeyKey[];
-extern const char kMouseEventShiftKeyKey[];
-
-// toDataUrl values
-extern const char kFormatValueJpeg[];
-extern const char kFormatValuePng[];
-extern const char kMimeTypeJpeg[];
-extern const char kMimeTypePng[];
-
-// mouse values
-extern const char kMouseEventTypeValueMousedown[];
-extern const char kMouseEventTypeValueMouseup[];
-extern const char kMouseEventTypeValueClick[];
-extern const char kMouseEventTypeValueMousemove[];
-extern const char kMouseEventTypeValueMousewheel[];
-extern const int kMouseEventButtonValueLeft;
-extern const int kMouseEventButtonValueMiddle;
-extern const int kMouseEventButtonValueRight;
-
-// keyboard keys
-extern const char kKeyboardEventTypeKey[];
-extern const char kKeyboardEventCharCodeKey[];
-extern const char kKeyboardEventKeyCodeKey[];
-extern const char kKeyboardEventAltKeyKey[];
-extern const char kKeyboardEventCtrlKeyKey[];
-extern const char kKeyboardEventShiftKeyKey[];
-
-// keyboard values
-extern const char kKeyboardEventTypeValueKeypress[];
-extern const char kKeyboardEventTypeValueKeydown[];
-extern const char kKeyboardEventTypeValueKeyup[];
-
-// events
-extern const char kDispatchEvent[];
-extern const char kEventOnUpdated[];
-
-// errors
-extern const char kCurrentTabNotFound[];
-extern const char kInternalVisibleTabCaptureError[];
-extern const char kInvalidKeyboardEventObjectError[];
-extern const char kInvalidMouseEventObjectError[];
-extern const char kInvalidUrlError[];
-extern const char kNoCrashBrowserError[];
-extern const char kNoCurrentWindowError[];
-extern const char kNoMouseCoordinatesError[];
-extern const char kOffscreenTabNotFoundError[];
-extern const char kTabNotFoundError[];
-
-}; // namespace extension_offscreen_tabs_module_constants
-
-#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_OFFSCREEN_TABS_MODULE_CONSTANTS_H_
-
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index 450f0f0..0b323d4 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -1036,10 +1036,6 @@
'browser/extensions/extension_module.h',
'browser/extensions/extension_navigation_observer.cc',
'browser/extensions/extension_navigation_observer.h',
- 'browser/extensions/extension_offscreen_tabs_module.cc',
- 'browser/extensions/extension_offscreen_tabs_module.h',
- 'browser/extensions/extension_offscreen_tabs_module_constants.cc',
- 'browser/extensions/extension_offscreen_tabs_module_constants.h',
'browser/extensions/extension_omnibox_api.cc',
'browser/extensions/extension_omnibox_api.h',
'browser/extensions/extension_page_actions_module.cc',
diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi
index 77100ac..6f6d40b 100644
--- a/chrome/chrome_tests.gypi
+++ b/chrome/chrome_tests.gypi
@@ -2305,7 +2305,6 @@
'browser/extensions/extension_metrics_apitest.cc',
'browser/extensions/extension_module_apitest.cc',
'browser/extensions/extension_nacl_browsertest.cc',
- 'browser/extensions/extension_offscreen_tabs_apitest.cc',
'browser/extensions/extension_omnibox_apitest.cc',
'browser/extensions/extension_override_apitest.cc',
'browser/extensions/extension_preference_apitest.cc',
diff --git a/chrome/common/extensions/api/extension_api.json b/chrome/common/extensions/api/extension_api.json
index 7601c60..a45b81c 100644
--- a/chrome/common/extensions/api/extension_api.json
+++ b/chrome/common/extensions/api/extension_api.json
@@ -8450,341 +8450,5 @@
]
}
]
- },
- {
- "namespace": "experimental.offscreenTabs",
- "types": [
- {
- "id": "OffscreenTab",
- "type": "object",
- "properties": {
- "id": {
- "type": "integer",
- "minimum": 0,
- "description": "The ID of the offscreen tab. Tab IDs are unique within a browser session."
- },
- "url": {
- "type":
- "string",
- "description": "URL of the offscreen tab."
- },
- "width": {
- "type": "integer",
- "minimum": 0,
- "description": "Width of the window."
- },
- "height": {
- "type": "integer",
- "minimum": 0,
- "description": "Height of the window."
- }
- }
- }
- ],
- "functions": [
- {
- "name": "create",
- "type": "function",
- "description": "Creates a new offscreen tab.",
- "parameters": [
- {
- "name": "createProperties",
- "type": "object",
- "properties": {
- "url": {
- "type": "string",
- "description": "The URL to navigate the offscreen tab to initially. Fully-qualified URLs must include a scheme (i.e. 'http://www.google.com', not 'www.google.com'). Relative URLs will be relative to the current page within the extension."
- },
- "width": {
- "type": "integer",
- "optional": true,
- "minimum": 0,
- "description": "Width of the offscreen tab. Defaults to width of the current tab."
- },
- "height": {
- "type": "integer",
- "optional": true,
- "minimum": 0,
- "description": "Height of the offscreen tab. Defaults to height of the current tab."
- }
- }
- },
- {
- "name": "callback",
- "type": "function",
- "optional": true,
- "parameters": [
- {
- "name": "offscreenTab",
- "$ref": "OffscreenTab",
- "optional": true,
- "description": "Details of the offscreen tab."
- }
- ]
- }
- ]
- },
- {
- "name": "get",
- "type": "function",
- "description": "Gets details about the specified offscreen tab.",
- "parameters": [
- {
- "name": "offscreenTabId",
- "type": "integer",
- "minimum": 0,
- "description": "ID of the offscreen tab."
- },
- {
- "name": "callback",
- "type": "function",
- "parameters": [
- {
- "name": "offscreenTab",
- "$ref": "OffscreenTab",
- "description": "Details of the offscreen tab."
- }
- ]
- }
- ]
- },
- {
- "name": "getAll",
- "type": "function",
- "description": "Gets an array of all offscreen tabs.",
- "parameters": [
- {
- "name": "callback",
- "type": "function",
- "parameters": [
- {
- "name": "offscreenTabs",
- "type": "array",
- "items": {
- "$ref": "OffscreenTab"
- }
- }
- ]
- }
- ]
- },
- {
- "name": "remove",
- "type": "function",
- "description": "Removes an offscreen tab.",
- "parameters": [
- {
- "name": "offscreenTabId",
- "type": "integer",
- "minimum": 0,
- "description": "ID of the offscreen tab."
- },
- {
- "name": "callback",
- "type": "function",
- "optional": true
- }
- ]
- },
- {
- "name": "sendMouseEvent",
- "type": "function",
- "description": "Dispatches a mouse event in the offscreen tab.",
- "parameters": [
- {
- "name": "offscreenTabId",
- "type": "integer",
- "minimum": 0,
- "description": "ID of the offscreen tab."
- },
- {
- "name": "mouseEvent",
- "type": "any",
- "description": "A JavaScript MouseEvent object. Supported event types: <i>mousedown</i>, <i>mouseup</i>, <i>click</i>, <i>mousemove</i>, <i>mousewheel</i>."
- },
- {
- "name": "x",
- "type": "integer",
- "optional": true,
- "minimum": 0,
- "description": "X position of where the mouse event should be dispatched on the offscreen web page. Not required in the case of a mousewheel event."
- },
- {
- "name": "y",
- "type": "integer",
- "optional": true,
- "minimum": 0,
- "description": "Y position of where the mouse event should be dispatched on the offscreen web page. Not required in the case of a mousewheel event."
- },
- {
- "name": "callback",
- "type": "function",
- "optional": true,
- "parameters": [
- {
- "name": "offscreenTab",
- "$ref": "OffscreenTab",
- "description": "Details of the offscreen tab."
- }
- ]
- }
- ]
- },
- {
- "name": "sendKeyboardEvent",
- "type": "function",
- "description": "Dispatches a keyboard event in the offscreen tab.",
- "parameters": [
- {
- "name": "offscreenTabId",
- "type": "integer",
- "minimum": 0,
- "description": "ID of the offscreen tab."
- },
- {
- "name": "keyboardEvent",
- "type": "any",
- "description": "A JavaScript KeyboardEvent object. Supported event types: <i>keydown</i>, <i>keyup</i>, <i>keypress</i>. Note, only <i>keypress</i> produces a visible result on screen."
- },
- {
- "name": "callback",
- "type": "function",
- "optional": true,
- "parameters": [
- {
- "name": "offscreenTab",
- "$ref": "OffscreenTab",
- "description": "Details of the offscreen tab."
- }
- ]
- }
- ]
- },
- {
- "name": "toDataUrl",
- "type": "function",
- "description": "Captures the visible area of an offscreen tab. ",
- "parameters": [
- {
- "name": "offscreenTabId",
- "type": "integer",
- "minimum": 0,
- "description": "The ID of the offscreen tab."
- },
- {
- "name": "options",
- "type": "object",
- "optional": true,
- "description": "Set parameters of image capture, such as the format of the resulting image.",
- "properties": {
- "format": {
- "type": "string",
- "optional": true,
- "enum": ["jpeg", "png"],
- "description": "The format of the resulting image. Default is jpeg."
- },
- "quality": {
- "type": "integer",
- "optional": true,
- "minimum": 0,
- "maximum": 100,
- "description": "When format is 'jpeg', controls the quality of the resulting image. This value is ignored for PNG images. As quality is decreased, the resulting image will have more visual artifacts, and the number of bytes needed to store it will decrease."
- }
- }
- },
- {
- "name": "callback",
- "type": "function",
- "parameters": [
- {
- "name": "dataUrl",
- "type": "string",
- "description": "A data URL which encodes an image of the visible area of the captured offscreen tab. May be assigned to the 'src' property of an HTML Image element or WebGL texture source for display."
- }
- ]
- }
- ]
- },
- {
- "name": "update",
- "type": "function",
- "description": "Modifies the properties of an offscreen tab. Properties that are not specified in updateProperties are not modified.",
- "parameters": [
- {
- "name": "offscreenTabId",
- "type": "integer",
- "minimum": 0,
- "description": "The ID of the offscreen tab."
- },
- {
- "name": "updateProperties",
- "type": "object",
- "properties": {
- "url": {
- "type": "string",
- "optional": true,
- "description": "The URL the offscreen tab is displaying."
- },
- "width": {
- "type": "integer",
- "optional": true,
- "minimum": 0,
- "description": "Width of the window."
- },
- "height": {
- "type": "integer",
- "optional": true,
- "minimum": 0,
- "description": "Height of the window."
- }
- }
- },
- {
- "name": "callback",
- "type": "function",
- "optional": true,
- "parameters": [
- {
- "name": "offscreenTab",
- "$ref": "OffscreenTab",
- "description": "Details of the offscreen tab."
- }
- ]
- }
- ]
- }
- ],
- "events": [
- {
- "name": "onUpdated",
- "type": "function",
- "description": "Fires when an offscreen tab is updated. ",
- "parameters": [
- {
- "name": "offscreenTabId",
- "type": "integer",
- "minimum": 0,
- "description": "ID of the updated offscreen tab"
- },
- {
- "name": "changeInfo",
- "type": "object",
- "description": "Lists the changes to the state of the offscreen tab that was updated.",
- "properties": {
- "url": {
- "type": "string",
- "optional": true,
- "description": "The offscreen tab's URL if it has changed."
- }
- }
- },
- {
- "name": "offscreenTab",
- "$ref": "OffscreenTab",
- "description": "Details of the offscreen tab."
- }
- ]
- }
- ]
}
]
diff --git a/chrome/common/extensions/docs/experimental.html b/chrome/common/extensions/docs/experimental.html
index 9dadce4..c3604e8 100644
--- a/chrome/common/extensions/docs/experimental.html
+++ b/chrome/common/extensions/docs/experimental.html
@@ -368,7 +368,6 @@ on the following experimental APIs:
<a href="experimental.devtools.network.html">experimental.devtools.network</a></li><li>
<a href="experimental.devtools.panels.html">experimental.devtools.panels</a></li><li>
<a href="experimental.infobars.html">experimental.infobars</a></li><li>
- <a href="experimental.offscreenTabs.html">experimental.offscreenTabs</a></li><li>
<a href="experimental.permissions.html">experimental.permissions</a></li><li>
<a href="experimental.privacy.html">experimental.privacy</a></li><li>
<a href="experimental.settings.html">experimental.settings</a></li><li>
diff --git a/chrome/common/extensions/docs/experimental.offscreenTabs.html b/chrome/common/extensions/docs/experimental.offscreenTabs.html
deleted file mode 100644
index f40b350..0000000
--- a/chrome/common/extensions/docs/experimental.offscreenTabs.html
+++ /dev/null
@@ -1,4028 +0,0 @@
-<!DOCTYPE html><!-- This page is a placeholder for generated extensions api doc. Note:
- 1) The <head> information in this page is significant, should be uniform
- across api docs and should be edited only with knowledge of the
- templating mechanism.
- 3) All <body>.innerHTML is genereated as an rendering step. If viewed in a
- browser, it will be re-generated from the template, json schema and
- authored overview content.
- 4) The <body>.innerHTML is also generated by an offline step so that this
- page may easily be indexed by search engines.
---><html xmlns="http://www.w3.org/1999/xhtml"><head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <link href="css/ApiRefStyles.css" rel="stylesheet" type="text/css">
- <link href="css/print.css" rel="stylesheet" type="text/css" media="print">
- <script type="text/javascript" src="../../../third_party/jstemplate/jstemplate_compiled.js">
- </script>
- <script type="text/javascript" src="js/api_page_generator.js"></script>
- <script type="text/javascript" src="js/bootstrap.js"></script>
- <script type="text/javascript" src="js/sidebar.js"></script>
- <title>chrome.experimental.offscreenTabs - Google Chrome Extensions - Google Code</title></head>
- <body> <div id="gc-container" class="labs">
- <div id="devModeWarning">
- You are viewing extension docs in chrome via the 'file:' scheme: are you expecting to see local changes when you refresh? You'll need run chrome with --allow-file-access-from-files.
- </div>
- <!-- SUBTEMPLATES: DO NOT MOVE FROM THIS LOCATION -->
- <!-- In particular, sub-templates that recurse, must be used by allowing
- jstemplate to make a copy of the template in this section which
- are not operated on by way of the jsskip="true" -->
- <div style="display:none">
-
- <!-- VALUE -->
- <div id="valueTemplate">
- <dt>
- <var>paramName</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional">optional</span>
- <span class="enum">enumerated</span>
- <span id="typeTemplate">
- <span>
- <a> Type</a>
- </span>
- <span>
- <span>
- array of <span><span></span></span>
- </span>
- <span>paramType</span>
- <span></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo">
- Undocumented.
- </dd>
- <dd>
- Description of this parameter from the json schema.
- </dd>
- <dd>
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd>
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd>
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd>
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd>
- <div></div>
- </dd>
-
- </div> <!-- /VALUE -->
-
- <div id="functionParametersTemplate">
- <h5>Parameters</h5>
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </div>
- </div> <!-- /SUBTEMPLATES -->
-
- <a id="top"></a>
- <div id="skipto">
- <a href="#gc-pagecontent">Skip to page content</a>
- <a href="#gc-toc">Skip to main navigation</a>
- </div>
- <!-- API HEADER -->
- <table id="header" width="100%" cellspacing="0" border="0">
- <tbody><tr>
- <td valign="middle"><a href="http://code.google.com/"><img src="images/code_labs_logo.gif" height="43" width="161" alt="Google Code Labs" style="border:0; margin:0;"></a></td>
- <td valign="middle" width="100%" style="padding-left:0.6em;">
- <form action="http://www.google.com/cse" id="cse" style="margin-top:0.5em">
- <div id="gsc-search-box">
- <input type="hidden" name="cx" value="002967670403910741006:61_cvzfqtno">
- <input type="hidden" name="ie" value="UTF-8">
- <input type="text" name="q" value="" size="55">
- <input class="gsc-search-button" type="submit" name="sa" value="Search">
- <br>
- <span class="greytext">e.g. "page action" or "tabs"</span>
- </div>
- </form>
-
- <script type="text/javascript" src="http://www.google.com/jsapi"></script>
- <script type="text/javascript">google.load("elements", "1", {packages: "transliteration"});</script>
- <script type="text/javascript" src="http://www.google.com/coop/cse/t13n?form=cse&amp;t13n_langs=en"></script>
- <script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse&amp;lang=en"></script>
- </td>
- </tr>
- </tbody></table>
-
- <div id="codesiteContent" class="">
-
- <a id="gc-topnav-anchor"></a>
- <div id="gc-topnav">
- <h1>Google Chrome Extensions (<a href="http://code.google.com/labs/">Labs</a>)</h1>
- <ul id="home" class="gc-topnav-tabs">
- <li id="home_link">
- <a href="index.html" title="Google Chrome Extensions home page">Home</a>
- </li>
- <li id="docs_link">
- <a href="docs.html" title="Official Google Chrome Extensions documentation">Docs</a>
- </li>
- <li id="faq_link">
- <a href="faq.html" title="Answers to frequently asked questions about Google Chrome Extensions">FAQ</a>
- </li>
- <li id="samples_link">
- <a href="samples.html" title="Sample extensions (with source code)">Samples</a>
- </li>
- <li id="group_link">
- <a href="http://groups.google.com/a/chromium.org/group/chromium-extensions" title="Google Chrome Extensions developer forum">Group</a>
- </li>
- </ul>
- </div> <!-- end gc-topnav -->
-
- <div class="g-section g-tpl-170">
- <!-- SIDENAV -->
- <div class="g-unit g-first" id="gc-toc">
- <ul>
- <li><a href="getstarted.html">Getting Started</a></li>
- <li><a href="overview.html">Overview</a></li>
- <li><a href="whats_new.html">What's New?</a></li>
- <li><h2><a href="devguide.html">Developer's Guide</a></h2>
- <ul>
- <li>Browser UI
- <ul>
- <li><a href="browserAction.html">Browser Actions</a></li>
- <li><a href="contextMenus.html">Context Menus</a></li>
- <li><a href="notifications.html">Desktop Notifications</a></li>
- <li><a href="omnibox.html">Omnibox</a></li>
- <li><a href="options.html">Options Pages</a></li>
- <li><a href="override.html">Override Pages</a></li>
- <li><a href="pageAction.html">Page Actions</a></li>
- </ul>
- </li>
- <li>Browser Interaction
- <ul>
- <li><a href="bookmarks.html">Bookmarks</a></li>
- <li><a href="cookies.html">Cookies</a></li>
- <li><a href="events.html">Events</a></li>
- <li><a href="history.html">History</a></li>
- <li><a href="management.html">Management</a></li>
- <li><a href="tabs.html">Tabs</a></li>
- <li><a href="windows.html">Windows</a></li>
- </ul>
- </li>
- <li>Implementation
- <ul>
- <li><a href="a11y.html">Accessibility</a></li>
- <li><a href="background_pages.html">Background Pages</a></li>
- <li><a href="content_scripts.html">Content Scripts</a></li>
- <li><a href="xhr.html">Cross-Origin XHR</a></li>
- <li><a href="i18n.html">Internationalization</a></li>
- <li><a href="messaging.html">Message Passing</a></li>
- <li><a href="npapi.html">NPAPI Plugins</a></li>
- </ul>
- </li>
- <li>Finishing
- <ul>
- <li><a href="hosting.html">Hosting</a></li>
- <li><a href="external_extensions.html">Other Deployment Options</a></li>
- </ul>
- </li>
- </ul>
- </li>
- <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
- <li><h2><a href="tutorials.html">Tutorials</a></h2>
- <ul>
- <li><a href="tut_debugging.html">Debugging</a></li>
- <li><a href="tut_analytics.html">Google Analytics</a></li>
- <li><a href="tut_oauth.html">OAuth</a></li>
- </ul>
- </li>
- <li><h2>Reference</h2>
- <ul>
- <li>Formats
- <ul>
- <li><a href="manifest.html">Manifest Files</a></li>
- <li><a href="match_patterns.html">Match Patterns</a></li>
- </ul>
- </li>
- <li><a href="permission_warnings.html">Permission Warnings</a></li>
- <li><a href="api_index.html">chrome.* APIs</a></li>
- <li><a href="api_other.html">Other APIs</a></li>
- </ul>
- </li>
- <li><h2><a href="samples.html">Samples</a></h2></li>
- <div class="line"> </div>
- <li><h2>More</h2>
- <ul>
- <li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
- <li><a href="themes.html">Themes</a></li>
- </ul>
- </li>
- </ul>
- </div>
- <script>
- initToggles();
- </script>
-
- <div class="g-unit" id="gc-pagecontent">
- <div id="pageTitle">
- <h1 class="page_title">chrome.experimental.offscreenTabs</h1>
- </div>
- <!-- TABLE OF CONTENTS -->
- <div id="toc">
- <h2>Contents</h2>
- <ol>
- <li style="display: none; ">
- <a>h2Name</a>
- <ol>
- <li>
- <a>h3Name</a>
- </li>
- </ol>
- </li>
- <li>
- <a href="#apiReference">API reference: chrome.experimental.offscreenTabs</a>
- <ol>
- <li style="display: none; ">
- <a href="#properties">Properties</a>
- <ol>
- <li>
- <a href="#property-anchor">propertyName</a>
- </li>
- </ol>
- </li>
- <li>
- <a href="#global-methods">Methods</a>
- <ol>
- <li>
- <a href="#method-create">create</a>
- </li><li>
- <a href="#method-get">get</a>
- </li><li>
- <a href="#method-getAll">getAll</a>
- </li><li>
- <a href="#method-remove">remove</a>
- </li><li>
- <a href="#method-sendKeyboardEvent">sendKeyboardEvent</a>
- </li><li>
- <a href="#method-sendMouseEvent">sendMouseEvent</a>
- </li><li>
- <a href="#method-toDataUrl">toDataUrl</a>
- </li><li>
- <a href="#method-update">update</a>
- </li>
- </ol>
- </li>
- <li>
- <a href="#global-events">Events</a>
- <ol>
- <li>
- <a href="#event-onUpdated">onUpdated</a>
- </li>
- </ol>
- </li>
- <li>
- <a href="#types">Types</a>
- <ol>
- <li>
- <a href="#type-OffscreenTab">OffscreenTab</a>
- </li>
- </ol>
- </li>
- </ol>
- </li>
- </ol>
- </div>
- <!-- /TABLE OF CONTENTS -->
-
- <!-- Standard content lead-in for experimental API pages -->
- <p id="classSummary">
- For information on how to use experimental APIs, see the <a href="experimental.html">chrome.experimental.* APIs</a> page.
- </p>
-
- <!-- STATIC CONTENT PLACEHOLDER -->
- <div id="static"></div>
-
- <!-- API PAGE -->
- <div class="apiPage">
- <a name="apiReference"></a>
- <h2>API reference: chrome.experimental.offscreenTabs</h2>
-
- <!-- PROPERTIES -->
- <div class="apiGroup" style="display: none; ">
- <a name="properties"></a>
- <h3 id="properties">Properties</h3>
-
- <div>
- <a></a>
- <h4>getLastError</h4>
- <div class="summary">
- <!-- Note: intentionally longer 80 columns -->
- <span>chrome.extension</span><span>lastError</span>
- </div>
- <div>
- </div>
- </div>
-
- </div> <!-- /apiGroup -->
-
- <!-- METHODS -->
- <div id="methodsTemplate" class="apiGroup">
- <a name="global-methods"></a>
- <h3>Methods</h3>
-
- <!-- iterates over all functions -->
- <div class="apiItem">
- <a name="method-create"></a> <!-- method-anchor -->
- <h4>create</h4>
-
- <div class="summary"><span style="display: none; ">void</span>
- <!-- Note: intentionally longer 80 columns -->
- <span>chrome.experimental.offscreenTabs.create</span>(<span class="null"><span style="display: none; ">, </span><span>object</span>
- <var><span>createProperties</span></var></span><span class="optional"><span>, </span><span>function</span>
- <var><span>callback</span></var></span>)</div>
-
- <div class="description">
- <p class="todo" style="display: none; ">Undocumented.</p>
- <p>Creates a new offscreen tab.</p>
-
- <!-- PARAMETERS -->
- <h4>Parameters</h4>
- <dl>
- <div>
- <div>
- <dt>
- <var>createProperties</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional" style="display: none; ">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span style="display: none; ">
- <a> Type</a>
- </span>
- <span>
- <span style="display: none; ">
- array of <span><span></span></span>
- </span>
- <span>object</span>
- <span style="display: none; "></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo">
- Undocumented.
- </dd>
- <dd style="display: none; ">
- Description of this parameter from the json schema.
- </dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd>
- <dl>
- <div>
- <div>
- <dt>
- <var>url</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional" style="display: none; ">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span style="display: none; ">
- <a> Type</a>
- </span>
- <span>
- <span style="display: none; ">
- array of <span><span></span></span>
- </span>
- <span>string</span>
- <span style="display: none; "></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo" style="display: none; ">
- Undocumented.
- </dd>
- <dd>The URL to navigate the offscreen tab to initially. Fully-qualified URLs must include a scheme (i.e. 'http://www.google.com', not 'www.google.com'). Relative URLs will be relative to the current page within the extension.</dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd style="display: none; ">
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div><div>
- <div>
- <dt>
- <var>width</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span style="display: none; ">
- <a> Type</a>
- </span>
- <span>
- <span style="display: none; ">
- array of <span><span></span></span>
- </span>
- <span>integer</span>
- <span style="display: none; "></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo" style="display: none; ">
- Undocumented.
- </dd>
- <dd>Width of the offscreen tab. Defaults to width of the current tab.</dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd style="display: none; ">
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div><div>
- <div>
- <dt>
- <var>height</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span style="display: none; ">
- <a> Type</a>
- </span>
- <span>
- <span style="display: none; ">
- array of <span><span></span></span>
- </span>
- <span>integer</span>
- <span style="display: none; "></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo" style="display: none; ">
- Undocumented.
- </dd>
- <dd>Height of the offscreen tab. Defaults to height of the current tab.</dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd style="display: none; ">
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div><div>
- <div>
- <dt>
- <var>callback</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span style="display: none; ">
- <a> Type</a>
- </span>
- <span>
- <span style="display: none; ">
- array of <span><span></span></span>
- </span>
- <span>function</span>
- <span style="display: none; "></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo">
- Undocumented.
- </dd>
- <dd style="display: none; ">
- Description of this parameter from the json schema.
- </dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd style="display: none; ">
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div>
- </dl>
-
- <!-- RETURNS -->
- <h4 style="display: none; ">Returns</h4>
- <dl>
- <div style="display: none; ">
- <div>
- </div>
- </div>
- </dl>
-
- <!-- CALLBACK -->
- <div>
- <div>
- <h4>Callback function</h4>
- <p style="display: none; ">
- The callback <em>parameter</em> should specify a function
- that looks like this:
- </p>
- <p>
- If you specify the <em>callback</em> parameter, it should
- specify a function that looks like this:
- </p>
-
- <!-- Note: intentionally longer 80 columns -->
- <pre>function(<span>OffscreenTab offscreenTab</span>) <span class="subdued">{...}</span>;</pre>
- <dl>
- <div>
- <div>
- <dt>
- <var>offscreenTab</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span>
- <a href="experimental.offscreenTabs.html#type-OffscreenTab">OffscreenTab</a>
- </span>
- <span style="display: none; ">
- <span>
- array of <span><span></span></span>
- </span>
- <span>paramType</span>
- <span></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo" style="display: none; ">
- Undocumented.
- </dd>
- <dd>Details of the offscreen tab.</dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd style="display: none; ">
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div>
- </dl>
- </div>
- </div>
-
- <!-- MIN_VERSION -->
- <p style="display: none; ">
- This function was added in version <b><span></span></b>.
- If you require this function, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </p>
- </div> <!-- /description -->
-
- </div><div class="apiItem">
- <a name="method-get"></a> <!-- method-anchor -->
- <h4>get</h4>
-
- <div class="summary"><span style="display: none; ">void</span>
- <!-- Note: intentionally longer 80 columns -->
- <span>chrome.experimental.offscreenTabs.get</span>(<span class="null"><span style="display: none; ">, </span><span>integer</span>
- <var><span>offscreenTabId</span></var></span><span class="null"><span>, </span><span>function</span>
- <var><span>callback</span></var></span>)</div>
-
- <div class="description">
- <p class="todo" style="display: none; ">Undocumented.</p>
- <p>Gets details about the specified offscreen tab.</p>
-
- <!-- PARAMETERS -->
- <h4>Parameters</h4>
- <dl>
- <div>
- <div>
- <dt>
- <var>offscreenTabId</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional" style="display: none; ">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span style="display: none; ">
- <a> Type</a>
- </span>
- <span>
- <span style="display: none; ">
- array of <span><span></span></span>
- </span>
- <span>integer</span>
- <span style="display: none; "></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo" style="display: none; ">
- Undocumented.
- </dd>
- <dd>ID of the offscreen tab.</dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd style="display: none; ">
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div><div>
- <div>
- <dt>
- <var>callback</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional" style="display: none; ">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span style="display: none; ">
- <a> Type</a>
- </span>
- <span>
- <span style="display: none; ">
- array of <span><span></span></span>
- </span>
- <span>function</span>
- <span style="display: none; "></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo">
- Undocumented.
- </dd>
- <dd style="display: none; ">
- Description of this parameter from the json schema.
- </dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd style="display: none; ">
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div>
- </dl>
-
- <!-- RETURNS -->
- <h4 style="display: none; ">Returns</h4>
- <dl>
- <div style="display: none; ">
- <div>
- </div>
- </div>
- </dl>
-
- <!-- CALLBACK -->
- <div>
- <div>
- <h4>Callback function</h4>
- <p>
- The callback <em>parameter</em> should specify a function
- that looks like this:
- </p>
- <p style="display: none; ">
- If you specify the <em>callback</em> parameter, it should
- specify a function that looks like this:
- </p>
-
- <!-- Note: intentionally longer 80 columns -->
- <pre>function(<span>OffscreenTab offscreenTab</span>) <span class="subdued">{...}</span>;</pre>
- <dl>
- <div>
- <div>
- <dt>
- <var>offscreenTab</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional" style="display: none; ">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span>
- <a href="experimental.offscreenTabs.html#type-OffscreenTab">OffscreenTab</a>
- </span>
- <span style="display: none; ">
- <span>
- array of <span><span></span></span>
- </span>
- <span>paramType</span>
- <span></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo" style="display: none; ">
- Undocumented.
- </dd>
- <dd>Details of the offscreen tab.</dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd style="display: none; ">
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div>
- </dl>
- </div>
- </div>
-
- <!-- MIN_VERSION -->
- <p style="display: none; ">
- This function was added in version <b><span></span></b>.
- If you require this function, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </p>
- </div> <!-- /description -->
-
- </div><div class="apiItem">
- <a name="method-getAll"></a> <!-- method-anchor -->
- <h4>getAll</h4>
-
- <div class="summary"><span style="display: none; ">void</span>
- <!-- Note: intentionally longer 80 columns -->
- <span>chrome.experimental.offscreenTabs.getAll</span>(<span class="null"><span style="display: none; ">, </span><span>function</span>
- <var><span>callback</span></var></span>)</div>
-
- <div class="description">
- <p class="todo" style="display: none; ">Undocumented.</p>
- <p>Gets an array of all offscreen tabs.</p>
-
- <!-- PARAMETERS -->
- <h4>Parameters</h4>
- <dl>
- <div>
- <div>
- <dt>
- <var>callback</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional" style="display: none; ">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span style="display: none; ">
- <a> Type</a>
- </span>
- <span>
- <span style="display: none; ">
- array of <span><span></span></span>
- </span>
- <span>function</span>
- <span style="display: none; "></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo">
- Undocumented.
- </dd>
- <dd style="display: none; ">
- Description of this parameter from the json schema.
- </dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd style="display: none; ">
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div>
- </dl>
-
- <!-- RETURNS -->
- <h4 style="display: none; ">Returns</h4>
- <dl>
- <div style="display: none; ">
- <div>
- </div>
- </div>
- </dl>
-
- <!-- CALLBACK -->
- <div>
- <div>
- <h4>Callback function</h4>
- <p>
- The callback <em>parameter</em> should specify a function
- that looks like this:
- </p>
- <p style="display: none; ">
- If you specify the <em>callback</em> parameter, it should
- specify a function that looks like this:
- </p>
-
- <!-- Note: intentionally longer 80 columns -->
- <pre>function(<span>array of OffscreenTab offscreenTabs</span>) <span class="subdued">{...}</span>;</pre>
- <dl>
- <div>
- <div>
- <dt>
- <var>offscreenTabs</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional" style="display: none; ">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span style="display: none; ">
- <a> Type</a>
- </span>
- <span>
- <span>
- array of <span><span>
- <span>
- <a href="experimental.offscreenTabs.html#type-OffscreenTab">OffscreenTab</a>
- </span>
- <span style="display: none; ">
- <span>
- array of <span><span></span></span>
- </span>
- <span>paramType</span>
- <span></span>
- </span>
- </span></span>
- </span>
- <span style="display: none; ">paramType</span>
- <span style="display: none; "></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo">
- Undocumented.
- </dd>
- <dd style="display: none; ">
- Description of this parameter from the json schema.
- </dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd style="display: none; ">
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div>
- </dl>
- </div>
- </div>
-
- <!-- MIN_VERSION -->
- <p style="display: none; ">
- This function was added in version <b><span></span></b>.
- If you require this function, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </p>
- </div> <!-- /description -->
-
- </div><div class="apiItem">
- <a name="method-remove"></a> <!-- method-anchor -->
- <h4>remove</h4>
-
- <div class="summary"><span style="display: none; ">void</span>
- <!-- Note: intentionally longer 80 columns -->
- <span>chrome.experimental.offscreenTabs.remove</span>(<span class="null"><span style="display: none; ">, </span><span>integer</span>
- <var><span>offscreenTabId</span></var></span><span class="optional"><span>, </span><span>function</span>
- <var><span>callback</span></var></span>)</div>
-
- <div class="description">
- <p class="todo" style="display: none; ">Undocumented.</p>
- <p>Removes an offscreen tab.</p>
-
- <!-- PARAMETERS -->
- <h4>Parameters</h4>
- <dl>
- <div>
- <div>
- <dt>
- <var>offscreenTabId</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional" style="display: none; ">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span style="display: none; ">
- <a> Type</a>
- </span>
- <span>
- <span style="display: none; ">
- array of <span><span></span></span>
- </span>
- <span>integer</span>
- <span style="display: none; "></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo" style="display: none; ">
- Undocumented.
- </dd>
- <dd>ID of the offscreen tab.</dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd style="display: none; ">
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div><div>
- <div>
- <dt>
- <var>callback</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span style="display: none; ">
- <a> Type</a>
- </span>
- <span>
- <span style="display: none; ">
- array of <span><span></span></span>
- </span>
- <span>function</span>
- <span style="display: none; "></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo">
- Undocumented.
- </dd>
- <dd style="display: none; ">
- Description of this parameter from the json schema.
- </dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd style="display: none; ">
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div>
- </dl>
-
- <!-- RETURNS -->
- <h4 style="display: none; ">Returns</h4>
- <dl>
- <div style="display: none; ">
- <div>
- </div>
- </div>
- </dl>
-
- <!-- CALLBACK -->
- <div>
- <div>
- <h4>Callback function</h4>
- <p style="display: none; ">
- The callback <em>parameter</em> should specify a function
- that looks like this:
- </p>
- <p>
- If you specify the <em>callback</em> parameter, it should
- specify a function that looks like this:
- </p>
-
- <!-- Note: intentionally longer 80 columns -->
- <pre>function(<span>null</span>) <span class="subdued">{...}</span>;</pre>
- <dl>
- <div style="display: none; ">
- <div>
- </div>
- </div>
- </dl>
- </div>
- </div>
-
- <!-- MIN_VERSION -->
- <p style="display: none; ">
- This function was added in version <b><span></span></b>.
- If you require this function, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </p>
- </div> <!-- /description -->
-
- </div><div class="apiItem">
- <a name="method-sendKeyboardEvent"></a> <!-- method-anchor -->
- <h4>sendKeyboardEvent</h4>
-
- <div class="summary"><span style="display: none; ">void</span>
- <!-- Note: intentionally longer 80 columns -->
- <span>chrome.experimental.offscreenTabs.sendKeyboardEvent</span>(<span class="null"><span style="display: none; ">, </span><span>integer</span>
- <var><span>offscreenTabId</span></var></span><span class="null"><span>, </span><span>any</span>
- <var><span>keyboardEvent</span></var></span><span class="optional"><span>, </span><span>function</span>
- <var><span>callback</span></var></span>)</div>
-
- <div class="description">
- <p class="todo" style="display: none; ">Undocumented.</p>
- <p>Dispatches a keyboard event in the offscreen tab.</p>
-
- <!-- PARAMETERS -->
- <h4>Parameters</h4>
- <dl>
- <div>
- <div>
- <dt>
- <var>offscreenTabId</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional" style="display: none; ">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span style="display: none; ">
- <a> Type</a>
- </span>
- <span>
- <span style="display: none; ">
- array of <span><span></span></span>
- </span>
- <span>integer</span>
- <span style="display: none; "></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo" style="display: none; ">
- Undocumented.
- </dd>
- <dd>ID of the offscreen tab.</dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd style="display: none; ">
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div><div>
- <div>
- <dt>
- <var>keyboardEvent</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional" style="display: none; ">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span style="display: none; ">
- <a> Type</a>
- </span>
- <span>
- <span style="display: none; ">
- array of <span><span></span></span>
- </span>
- <span>any</span>
- <span style="display: none; "></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo" style="display: none; ">
- Undocumented.
- </dd>
- <dd>A JavaScript KeyboardEvent object. Supported event types: <i>keydown</i>, <i>keyup</i>, <i>keypress</i>. Note, only <i>keypress</i> produces a visible result on screen.</dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd style="display: none; ">
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div><div>
- <div>
- <dt>
- <var>callback</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span style="display: none; ">
- <a> Type</a>
- </span>
- <span>
- <span style="display: none; ">
- array of <span><span></span></span>
- </span>
- <span>function</span>
- <span style="display: none; "></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo">
- Undocumented.
- </dd>
- <dd style="display: none; ">
- Description of this parameter from the json schema.
- </dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd style="display: none; ">
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div>
- </dl>
-
- <!-- RETURNS -->
- <h4 style="display: none; ">Returns</h4>
- <dl>
- <div style="display: none; ">
- <div>
- </div>
- </div>
- </dl>
-
- <!-- CALLBACK -->
- <div>
- <div>
- <h4>Callback function</h4>
- <p style="display: none; ">
- The callback <em>parameter</em> should specify a function
- that looks like this:
- </p>
- <p>
- If you specify the <em>callback</em> parameter, it should
- specify a function that looks like this:
- </p>
-
- <!-- Note: intentionally longer 80 columns -->
- <pre>function(<span>OffscreenTab offscreenTab</span>) <span class="subdued">{...}</span>;</pre>
- <dl>
- <div>
- <div>
- <dt>
- <var>offscreenTab</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional" style="display: none; ">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span>
- <a href="experimental.offscreenTabs.html#type-OffscreenTab">OffscreenTab</a>
- </span>
- <span style="display: none; ">
- <span>
- array of <span><span></span></span>
- </span>
- <span>paramType</span>
- <span></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo" style="display: none; ">
- Undocumented.
- </dd>
- <dd>Details of the offscreen tab.</dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd style="display: none; ">
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div>
- </dl>
- </div>
- </div>
-
- <!-- MIN_VERSION -->
- <p style="display: none; ">
- This function was added in version <b><span></span></b>.
- If you require this function, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </p>
- </div> <!-- /description -->
-
- </div><div class="apiItem">
- <a name="method-sendMouseEvent"></a> <!-- method-anchor -->
- <h4>sendMouseEvent</h4>
-
- <div class="summary"><span style="display: none; ">void</span>
- <!-- Note: intentionally longer 80 columns -->
- <span>chrome.experimental.offscreenTabs.sendMouseEvent</span>(<span class="null"><span style="display: none; ">, </span><span>integer</span>
- <var><span>offscreenTabId</span></var></span><span class="null"><span>, </span><span>any</span>
- <var><span>mouseEvent</span></var></span><span class="optional"><span>, </span><span>integer</span>
- <var><span>x</span></var></span><span class="optional"><span>, </span><span>integer</span>
- <var><span>y</span></var></span><span class="optional"><span>, </span><span>function</span>
- <var><span>callback</span></var></span>)</div>
-
- <div class="description">
- <p class="todo" style="display: none; ">Undocumented.</p>
- <p>Dispatches a mouse event in the offscreen tab.</p>
-
- <!-- PARAMETERS -->
- <h4>Parameters</h4>
- <dl>
- <div>
- <div>
- <dt>
- <var>offscreenTabId</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional" style="display: none; ">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span style="display: none; ">
- <a> Type</a>
- </span>
- <span>
- <span style="display: none; ">
- array of <span><span></span></span>
- </span>
- <span>integer</span>
- <span style="display: none; "></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo" style="display: none; ">
- Undocumented.
- </dd>
- <dd>ID of the offscreen tab.</dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd style="display: none; ">
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div><div>
- <div>
- <dt>
- <var>mouseEvent</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional" style="display: none; ">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span style="display: none; ">
- <a> Type</a>
- </span>
- <span>
- <span style="display: none; ">
- array of <span><span></span></span>
- </span>
- <span>any</span>
- <span style="display: none; "></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo" style="display: none; ">
- Undocumented.
- </dd>
- <dd>A JavaScript MouseEvent object. Supported event types: <i>mousedown</i>, <i>mouseup</i>, <i>click</i>, <i>mousemove</i>, <i>mousewheel</i>.</dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd style="display: none; ">
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div><div>
- <div>
- <dt>
- <var>x</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span style="display: none; ">
- <a> Type</a>
- </span>
- <span>
- <span style="display: none; ">
- array of <span><span></span></span>
- </span>
- <span>integer</span>
- <span style="display: none; "></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo" style="display: none; ">
- Undocumented.
- </dd>
- <dd>X position of where the mouse event should be dispatched on the offscreen web page. Not required in the case of a mousewheel event.</dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd style="display: none; ">
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div><div>
- <div>
- <dt>
- <var>y</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span style="display: none; ">
- <a> Type</a>
- </span>
- <span>
- <span style="display: none; ">
- array of <span><span></span></span>
- </span>
- <span>integer</span>
- <span style="display: none; "></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo" style="display: none; ">
- Undocumented.
- </dd>
- <dd>Y position of where the mouse event should be dispatched on the offscreen web page. Not required in the case of a mousewheel event.</dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd style="display: none; ">
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div><div>
- <div>
- <dt>
- <var>callback</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span style="display: none; ">
- <a> Type</a>
- </span>
- <span>
- <span style="display: none; ">
- array of <span><span></span></span>
- </span>
- <span>function</span>
- <span style="display: none; "></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo">
- Undocumented.
- </dd>
- <dd style="display: none; ">
- Description of this parameter from the json schema.
- </dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd style="display: none; ">
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div>
- </dl>
-
- <!-- RETURNS -->
- <h4 style="display: none; ">Returns</h4>
- <dl>
- <div style="display: none; ">
- <div>
- </div>
- </div>
- </dl>
-
- <!-- CALLBACK -->
- <div>
- <div>
- <h4>Callback function</h4>
- <p style="display: none; ">
- The callback <em>parameter</em> should specify a function
- that looks like this:
- </p>
- <p>
- If you specify the <em>callback</em> parameter, it should
- specify a function that looks like this:
- </p>
-
- <!-- Note: intentionally longer 80 columns -->
- <pre>function(<span>OffscreenTab offscreenTab</span>) <span class="subdued">{...}</span>;</pre>
- <dl>
- <div>
- <div>
- <dt>
- <var>offscreenTab</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional" style="display: none; ">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span>
- <a href="experimental.offscreenTabs.html#type-OffscreenTab">OffscreenTab</a>
- </span>
- <span style="display: none; ">
- <span>
- array of <span><span></span></span>
- </span>
- <span>paramType</span>
- <span></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo" style="display: none; ">
- Undocumented.
- </dd>
- <dd>Details of the offscreen tab.</dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd style="display: none; ">
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div>
- </dl>
- </div>
- </div>
-
- <!-- MIN_VERSION -->
- <p style="display: none; ">
- This function was added in version <b><span></span></b>.
- If you require this function, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </p>
- </div> <!-- /description -->
-
- </div><div class="apiItem">
- <a name="method-toDataUrl"></a> <!-- method-anchor -->
- <h4>toDataUrl</h4>
-
- <div class="summary"><span style="display: none; ">void</span>
- <!-- Note: intentionally longer 80 columns -->
- <span>chrome.experimental.offscreenTabs.toDataUrl</span>(<span class="null"><span style="display: none; ">, </span><span>integer</span>
- <var><span>offscreenTabId</span></var></span><span class="optional"><span>, </span><span>object</span>
- <var><span>options</span></var></span><span class="null"><span>, </span><span>function</span>
- <var><span>callback</span></var></span>)</div>
-
- <div class="description">
- <p class="todo" style="display: none; ">Undocumented.</p>
- <p>Captures the visible area of an offscreen tab. </p>
-
- <!-- PARAMETERS -->
- <h4>Parameters</h4>
- <dl>
- <div>
- <div>
- <dt>
- <var>offscreenTabId</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional" style="display: none; ">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span style="display: none; ">
- <a> Type</a>
- </span>
- <span>
- <span style="display: none; ">
- array of <span><span></span></span>
- </span>
- <span>integer</span>
- <span style="display: none; "></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo" style="display: none; ">
- Undocumented.
- </dd>
- <dd>The ID of the offscreen tab.</dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd style="display: none; ">
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div><div>
- <div>
- <dt>
- <var>options</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span style="display: none; ">
- <a> Type</a>
- </span>
- <span>
- <span style="display: none; ">
- array of <span><span></span></span>
- </span>
- <span>object</span>
- <span style="display: none; "></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo" style="display: none; ">
- Undocumented.
- </dd>
- <dd>Set parameters of image capture, such as the format of the resulting image.</dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd>
- <dl>
- <div>
- <div>
- <dt>
- <var>format</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional">optional</span>
- <span class="enum">enumerated</span>
- <span id="typeTemplate">
- <span style="display: none; ">
- <a> Type</a>
- </span>
- <span>
- <span style="display: none; ">
- array of <span><span></span></span>
- </span>
- <span>string</span>
- <span>["jpeg", "png"]</span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo" style="display: none; ">
- Undocumented.
- </dd>
- <dd>The format of the resulting image. Default is jpeg.</dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd style="display: none; ">
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div><div>
- <div>
- <dt>
- <var>quality</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span style="display: none; ">
- <a> Type</a>
- </span>
- <span>
- <span style="display: none; ">
- array of <span><span></span></span>
- </span>
- <span>integer</span>
- <span style="display: none; "></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo" style="display: none; ">
- Undocumented.
- </dd>
- <dd>When format is 'jpeg', controls the quality of the resulting image. This value is ignored for PNG images. As quality is decreased, the resulting image will have more visual artifacts, and the number of bytes needed to store it will decrease.</dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd style="display: none; ">
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div><div>
- <div>
- <dt>
- <var>callback</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional" style="display: none; ">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span style="display: none; ">
- <a> Type</a>
- </span>
- <span>
- <span style="display: none; ">
- array of <span><span></span></span>
- </span>
- <span>function</span>
- <span style="display: none; "></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo">
- Undocumented.
- </dd>
- <dd style="display: none; ">
- Description of this parameter from the json schema.
- </dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd style="display: none; ">
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div>
- </dl>
-
- <!-- RETURNS -->
- <h4 style="display: none; ">Returns</h4>
- <dl>
- <div style="display: none; ">
- <div>
- </div>
- </div>
- </dl>
-
- <!-- CALLBACK -->
- <div>
- <div>
- <h4>Callback function</h4>
- <p>
- The callback <em>parameter</em> should specify a function
- that looks like this:
- </p>
- <p style="display: none; ">
- If you specify the <em>callback</em> parameter, it should
- specify a function that looks like this:
- </p>
-
- <!-- Note: intentionally longer 80 columns -->
- <pre>function(<span>string dataUrl</span>) <span class="subdued">{...}</span>;</pre>
- <dl>
- <div>
- <div>
- <dt>
- <var>dataUrl</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional" style="display: none; ">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span style="display: none; ">
- <a> Type</a>
- </span>
- <span>
- <span style="display: none; ">
- array of <span><span></span></span>
- </span>
- <span>string</span>
- <span style="display: none; "></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo" style="display: none; ">
- Undocumented.
- </dd>
- <dd>A data URL which encodes an image of the visible area of the captured offscreen tab. May be assigned to the 'src' property of an HTML Image element or WebGL texture source for display.</dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd style="display: none; ">
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div>
- </dl>
- </div>
- </div>
-
- <!-- MIN_VERSION -->
- <p style="display: none; ">
- This function was added in version <b><span></span></b>.
- If you require this function, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </p>
- </div> <!-- /description -->
-
- </div><div class="apiItem">
- <a name="method-update"></a> <!-- method-anchor -->
- <h4>update</h4>
-
- <div class="summary"><span style="display: none; ">void</span>
- <!-- Note: intentionally longer 80 columns -->
- <span>chrome.experimental.offscreenTabs.update</span>(<span class="null"><span style="display: none; ">, </span><span>integer</span>
- <var><span>offscreenTabId</span></var></span><span class="null"><span>, </span><span>object</span>
- <var><span>updateProperties</span></var></span><span class="optional"><span>, </span><span>function</span>
- <var><span>callback</span></var></span>)</div>
-
- <div class="description">
- <p class="todo" style="display: none; ">Undocumented.</p>
- <p>Modifies the properties of an offscreen tab. Properties that are not specified in updateProperties are not modified.</p>
-
- <!-- PARAMETERS -->
- <h4>Parameters</h4>
- <dl>
- <div>
- <div>
- <dt>
- <var>offscreenTabId</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional" style="display: none; ">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span style="display: none; ">
- <a> Type</a>
- </span>
- <span>
- <span style="display: none; ">
- array of <span><span></span></span>
- </span>
- <span>integer</span>
- <span style="display: none; "></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo" style="display: none; ">
- Undocumented.
- </dd>
- <dd>The ID of the offscreen tab.</dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd style="display: none; ">
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div><div>
- <div>
- <dt>
- <var>updateProperties</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional" style="display: none; ">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span style="display: none; ">
- <a> Type</a>
- </span>
- <span>
- <span style="display: none; ">
- array of <span><span></span></span>
- </span>
- <span>object</span>
- <span style="display: none; "></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo">
- Undocumented.
- </dd>
- <dd style="display: none; ">
- Description of this parameter from the json schema.
- </dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd>
- <dl>
- <div>
- <div>
- <dt>
- <var>url</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span style="display: none; ">
- <a> Type</a>
- </span>
- <span>
- <span style="display: none; ">
- array of <span><span></span></span>
- </span>
- <span>string</span>
- <span style="display: none; "></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo" style="display: none; ">
- Undocumented.
- </dd>
- <dd>The URL the offscreen tab is displaying.</dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd style="display: none; ">
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div><div>
- <div>
- <dt>
- <var>width</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span style="display: none; ">
- <a> Type</a>
- </span>
- <span>
- <span style="display: none; ">
- array of <span><span></span></span>
- </span>
- <span>integer</span>
- <span style="display: none; "></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo" style="display: none; ">
- Undocumented.
- </dd>
- <dd>Width of the window.</dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd style="display: none; ">
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div><div>
- <div>
- <dt>
- <var>height</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span style="display: none; ">
- <a> Type</a>
- </span>
- <span>
- <span style="display: none; ">
- array of <span><span></span></span>
- </span>
- <span>integer</span>
- <span style="display: none; "></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo" style="display: none; ">
- Undocumented.
- </dd>
- <dd>Height of the window.</dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd style="display: none; ">
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div><div>
- <div>
- <dt>
- <var>callback</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span style="display: none; ">
- <a> Type</a>
- </span>
- <span>
- <span style="display: none; ">
- array of <span><span></span></span>
- </span>
- <span>function</span>
- <span style="display: none; "></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo">
- Undocumented.
- </dd>
- <dd style="display: none; ">
- Description of this parameter from the json schema.
- </dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd style="display: none; ">
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div>
- </dl>
-
- <!-- RETURNS -->
- <h4 style="display: none; ">Returns</h4>
- <dl>
- <div style="display: none; ">
- <div>
- </div>
- </div>
- </dl>
-
- <!-- CALLBACK -->
- <div>
- <div>
- <h4>Callback function</h4>
- <p style="display: none; ">
- The callback <em>parameter</em> should specify a function
- that looks like this:
- </p>
- <p>
- If you specify the <em>callback</em> parameter, it should
- specify a function that looks like this:
- </p>
-
- <!-- Note: intentionally longer 80 columns -->
- <pre>function(<span>OffscreenTab offscreenTab</span>) <span class="subdued">{...}</span>;</pre>
- <dl>
- <div>
- <div>
- <dt>
- <var>offscreenTab</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional" style="display: none; ">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span>
- <a href="experimental.offscreenTabs.html#type-OffscreenTab">OffscreenTab</a>
- </span>
- <span style="display: none; ">
- <span>
- array of <span><span></span></span>
- </span>
- <span>paramType</span>
- <span></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo" style="display: none; ">
- Undocumented.
- </dd>
- <dd>Details of the offscreen tab.</dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd style="display: none; ">
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div>
- </dl>
- </div>
- </div>
-
- <!-- MIN_VERSION -->
- <p style="display: none; ">
- This function was added in version <b><span></span></b>.
- If you require this function, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </p>
- </div> <!-- /description -->
-
- </div> <!-- /apiItem -->
-
- </div> <!-- /apiGroup -->
-
- <!-- EVENTS -->
- <div id="eventsTemplate" class="apiGroup">
- <a name="global-events"></a>
- <h3>Events</h3>
- <!-- iterates over all events -->
- <div class="apiItem">
- <a name="event-onUpdated"></a>
- <h4>onUpdated</h4>
-
- <div class="summary">
- <!-- Note: intentionally longer 80 columns -->
- <span class="subdued">chrome.experimental.offscreenTabs.</span><span>onUpdated</span><span class="subdued">.addListener</span>(function(<span>integer offscreenTabId, object changeInfo, OffscreenTab offscreenTab</span>) <span class="subdued">{...}</span><span></span>);
- </div>
-
- <div class="description">
- <p class="todo" style="display: none; ">Undocumented.</p>
- <p>Fires when an offscreen tab is updated. </p>
-
- <!-- LISTENER PARAMETERS -->
- <div>
- <h4>Listener parameters</h4>
- <dl>
- <div>
- <div>
- <dt>
- <var>offscreenTabId</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional" style="display: none; ">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span style="display: none; ">
- <a> Type</a>
- </span>
- <span>
- <span style="display: none; ">
- array of <span><span></span></span>
- </span>
- <span>integer</span>
- <span style="display: none; "></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo" style="display: none; ">
- Undocumented.
- </dd>
- <dd>ID of the updated offscreen tab</dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd style="display: none; ">
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div><div>
- <div>
- <dt>
- <var>changeInfo</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional" style="display: none; ">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span style="display: none; ">
- <a> Type</a>
- </span>
- <span>
- <span style="display: none; ">
- array of <span><span></span></span>
- </span>
- <span>object</span>
- <span style="display: none; "></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo" style="display: none; ">
- Undocumented.
- </dd>
- <dd>Lists the changes to the state of the offscreen tab that was updated.</dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd>
- <dl>
- <div>
- <div>
- <dt>
- <var>url</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span style="display: none; ">
- <a> Type</a>
- </span>
- <span>
- <span style="display: none; ">
- array of <span><span></span></span>
- </span>
- <span>string</span>
- <span style="display: none; "></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo" style="display: none; ">
- Undocumented.
- </dd>
- <dd>The offscreen tab's URL if it has changed.</dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd style="display: none; ">
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div><div>
- <div>
- <dt>
- <var>offscreenTab</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional" style="display: none; ">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span>
- <a href="experimental.offscreenTabs.html#type-OffscreenTab">OffscreenTab</a>
- </span>
- <span style="display: none; ">
- <span>
- array of <span><span></span></span>
- </span>
- <span>paramType</span>
- <span></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo" style="display: none; ">
- Undocumented.
- </dd>
- <dd>Details of the offscreen tab.</dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd style="display: none; ">
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div>
- </dl>
- </div>
-
- <!-- EXTRA PARAMETERS -->
- <div style="display: none; ">
- <h4>Extra parameters to addListener</h4>
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </div>
-
- <!-- LISTENER RETURN VALUE -->
- <h4 style="display: none; ">Listener returns</h4>
- <dl>
- <div style="display: none; ">
- <div>
- </div>
- </div>
- </dl>
-
- </div> <!-- /description -->
- </div> <!-- /apiItem -->
-
- </div> <!-- /apiGroup -->
-
- <!-- TYPES -->
- <div class="apiGroup">
- <a name="types"></a>
- <h3 id="types">Types</h3>
-
- <!-- iterates over all types -->
- <div class="apiItem">
- <a name="type-OffscreenTab"></a>
- <h4>OffscreenTab</h4>
-
- <div>
- <dt>
- <var style="display: none; ">paramName</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional" style="display: none; ">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span style="display: none; ">
- <a> Type</a>
- </span>
- <span>
- <span style="display: none; ">
- array of <span><span></span></span>
- </span>
- <span>object</span>
- <span style="display: none; "></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo">
- Undocumented.
- </dd>
- <dd style="display: none; ">
- Description of this parameter from the json schema.
- </dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd>
- <dl>
- <div>
- <div>
- <dt>
- <var>id</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional" style="display: none; ">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span style="display: none; ">
- <a> Type</a>
- </span>
- <span>
- <span style="display: none; ">
- array of <span><span></span></span>
- </span>
- <span>integer</span>
- <span style="display: none; "></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo" style="display: none; ">
- Undocumented.
- </dd>
- <dd>The ID of the offscreen tab. Tab IDs are unique within a browser session.</dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd style="display: none; ">
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div><div>
- <div>
- <dt>
- <var>url</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional" style="display: none; ">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span style="display: none; ">
- <a> Type</a>
- </span>
- <span>
- <span style="display: none; ">
- array of <span><span></span></span>
- </span>
- <span>string</span>
- <span style="display: none; "></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo" style="display: none; ">
- Undocumented.
- </dd>
- <dd>URL of the offscreen tab.</dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd style="display: none; ">
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div><div>
- <div>
- <dt>
- <var>width</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional" style="display: none; ">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span style="display: none; ">
- <a> Type</a>
- </span>
- <span>
- <span style="display: none; ">
- array of <span><span></span></span>
- </span>
- <span>integer</span>
- <span style="display: none; "></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo" style="display: none; ">
- Undocumented.
- </dd>
- <dd>Width of the window.</dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd style="display: none; ">
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div><div>
- <div>
- <dt>
- <var>height</var>
- <em>
-
- <!-- TYPE -->
- <div style="display:inline">
- (
- <span class="optional" style="display: none; ">optional</span>
- <span class="enum" style="display: none; ">enumerated</span>
- <span id="typeTemplate">
- <span style="display: none; ">
- <a> Type</a>
- </span>
- <span>
- <span style="display: none; ">
- array of <span><span></span></span>
- </span>
- <span>integer</span>
- <span style="display: none; "></span>
- </span>
- </span>
- )
- </div>
-
- </em>
- </dt>
- <dd class="todo" style="display: none; ">
- Undocumented.
- </dd>
- <dd>Height of the window.</dd>
- <dd style="display: none; ">
- This parameter was added in version
- <b><span></span></b>.
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
- can ensure that your extension won't be run in an earlier browser version.
- </dd>
-
- <!-- OBJECT PROPERTIES -->
- <dd style="display: none; ">
- <dl>
- <div>
- <div>
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
- </div>
- </dl>
- </dd>
-
- <!-- OBJECT METHODS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- OBJECT EVENT FIELDS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- <!-- FUNCTION PARAMETERS -->
- <dd style="display: none; ">
- <div></div>
- </dd>
-
- </div>
-
- </div> <!-- /apiItem -->
-
- </div> <!-- /apiGroup -->
-
- </div> <!-- /apiPage -->
- </div> <!-- /gc-pagecontent -->
- </div> <!-- /g-section -->
- </div> <!-- /codesiteContent -->
- <div id="gc-footer" --="">
- <div class="text">
- <p>
- Except as otherwise <a href="http://code.google.com/policies.html#restrictions">noted</a>,
- the content of this page is licensed under the <a rel="license" href="http://creativecommons.org/licenses/by/3.0/">Creative Commons
- Attribution 3.0 License</a>, and code samples are licensed under the
- <a rel="license" href="http://code.google.com/google_bsd_license.html">BSD License</a>.
- </p>
- <p>
- ©2011 Google
- </p>
-
-<!-- begin analytics -->
-<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
-<script src="http://www.google-analytics.com/ga.js" type="text/javascript"></script>
-
-<script type="text/javascript">
- // chrome doc tracking
- try {
- var engdocs = _gat._getTracker("YT-10763712-2");
- engdocs._trackPageview();
- } catch(err) {}
-
- // code.google.com site-wide tracking
- try {
- _uacct="UA-18071-1";
- _uanchor=1;
- _uff=0;
- urchinTracker();
- }
- catch(e) {/* urchinTracker not available. */}
-</script>
-<!-- end analytics -->
- </div>
- </div> <!-- /gc-footer -->
- </div> <!-- /gc-container -->
-</body></html>
diff --git a/chrome/common/extensions/docs/samples.json b/chrome/common/extensions/docs/samples.json
index 64b1da6..5113b08 100644
--- a/chrome/common/extensions/docs/samples.json
+++ b/chrome/common/extensions/docs/samples.json
@@ -60,15 +60,6 @@
"chrome.experimental.devtools.network.onRequestFinished": "experimental.devtools.network.html#event-onRequestFinished",
"chrome.experimental.devtools.panels.create": "experimental.devtools.panels.html#method-create",
"chrome.experimental.infobars.show": "experimental.infobars.html#method-show",
- "chrome.experimental.offscreenTabs.create": "experimental.offscreenTabs.html#method-create",
- "chrome.experimental.offscreenTabs.get": "experimental.offscreenTabs.html#method-get",
- "chrome.experimental.offscreenTabs.getAll": "experimental.offscreenTabs.html#method-getAll",
- "chrome.experimental.offscreenTabs.onUpdated": "experimental.offscreenTabs.html#event-onUpdated",
- "chrome.experimental.offscreenTabs.remove": "experimental.offscreenTabs.html#method-remove",
- "chrome.experimental.offscreenTabs.sendKeyboardEvent": "experimental.offscreenTabs.html#method-sendKeyboardEvent",
- "chrome.experimental.offscreenTabs.sendMouseEvent": "experimental.offscreenTabs.html#method-sendMouseEvent",
- "chrome.experimental.offscreenTabs.toDataUrl": "experimental.offscreenTabs.html#method-toDataUrl",
- "chrome.experimental.offscreenTabs.update": "experimental.offscreenTabs.html#method-update",
"chrome.experimental.permissions.contains": "experimental.permissions.html#method-contains",
"chrome.experimental.permissions.getAll": "experimental.permissions.html#method-getAll",
"chrome.experimental.permissions.onAdded": "experimental.permissions.html#event-onAdded",
@@ -857,7 +848,7 @@
"devtools.js",
"manifest.json"
],
- "source_hash": "4d6a2fc67a692883e75a427b416bf782eda57cee",
+ "source_hash": "b607f6ca8f1ccf4343766b480ae21bb220dd949c",
"zip_path": "examples\/api\/devtools\/network\/chrome-firephp.zip"
},
{
@@ -1208,7 +1199,7 @@
"info.html",
"manifest.json"
],
- "source_hash": "672f49ed8edbe0829c7ba5a1d890b4440b157991",
+ "source_hash": "c746d9114348f4b414c1ec05e988e2807feb963a",
"zip_path": "examples\/extensions\/imageinfo.zip"
},
{
diff --git a/chrome/renderer/resources/extension_process_bindings.js b/chrome/renderer/resources/extension_process_bindings.js
index 98d717f..7081a44 100644
--- a/chrome/renderer/resources/extension_process_bindings.js
+++ b/chrome/renderer/resources/extension_process_bindings.js
@@ -1025,24 +1025,6 @@ var chrome = chrome || {};
return newArgs;
};
- apiFunctions["experimental.offscreenTabs.sendKeyboardEvent"].
- updateArgumentsPreValidate = function() {
- // Delete properties that are objects in order to be able to serialize.
- var arg1 = arguments[1];
-
- for (prop in arg1) {
- if (typeof arg1[prop] == "object")
- delete arg1[prop];
- }
-
- return arguments;
- };
-
- apiFunctions["experimental.offscreenTabs.sendMouseEvent"].
- updateArgumentsPreValidate =
- apiFunctions["experimental.offscreenTabs.sendKeyboardEvent"].
- updateArgumentsPreValidate;
-
apiFunctions["omnibox.sendSuggestions"].updateArgumentsPostValidate =
function(requestId, userSuggestions) {
var suggestions = [];
diff --git a/chrome/renderer/resources/renderer_extension_bindings.js b/chrome/renderer/resources/renderer_extension_bindings.js
index 488a5a9..52327c3 100644
--- a/chrome/renderer/resources/renderer_extension_bindings.js
+++ b/chrome/renderer/resources/renderer_extension_bindings.js
@@ -318,7 +318,6 @@ var chrome = chrome || {};
"experimental.input",
"experimental.inputUI",
"experimental.metrics",
- "experimental.offscreenTabs",
"experimental.permissions",
"experimental.settings",
"experimental.popup",
diff --git a/chrome/test/data/extensions/api_test/offscreen_tabs/a.html b/chrome/test/data/extensions/api_test/offscreen_tabs/a.html
deleted file mode 100644
index 9d2f29a..0000000
--- a/chrome/test/data/extensions/api_test/offscreen_tabs/a.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<html>
-
-<head>
- <script type="text/javascript">
- function keyboard(e) {
- if (e.charCode == 113) // q
- window.location = "b.html";
- }
- </script>
-</head>
-
-<body onkeypress="keyboard(event)">
- <a href="b.html" style="position:absolute; left:10px; top:10px;"> b.html </a>
-</body>
-
-</html>
diff --git a/chrome/test/data/extensions/api_test/offscreen_tabs/b.html b/chrome/test/data/extensions/api_test/offscreen_tabs/b.html
deleted file mode 100644
index d572adb..0000000
--- a/chrome/test/data/extensions/api_test/offscreen_tabs/b.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<html>
-
-<head>
-
-</head>
-
-<body>
- <a href="c.html" style="position:absolute; left:10px; top:110px;"> c.html </a>
-
- <span style="position:absolute; top:2000px;"> this is all the way down here to test scrolling </span>
-</body>
-
-</html>
diff --git a/chrome/test/data/extensions/api_test/offscreen_tabs/c.html b/chrome/test/data/extensions/api_test/offscreen_tabs/c.html
deleted file mode 100644
index 4546c04..0000000
--- a/chrome/test/data/extensions/api_test/offscreen_tabs/c.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<html>
-
-<head>
-
-</head>
-
-<body>
-
-</body>
-
-</html>
diff --git a/chrome/test/data/extensions/api_test/offscreen_tabs/manifest.json b/chrome/test/data/extensions/api_test/offscreen_tabs/manifest.json
deleted file mode 100644
index 0b2397e..0000000
--- a/chrome/test/data/extensions/api_test/offscreen_tabs/manifest.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "name": "chrome.experimental.offscreenTabs API test",
- "description": "",
- "version": "1",
- "background_page": "test.html",
- "permissions": [
- "experimental",
- "*://*/*"
- ]
-}
diff --git a/chrome/test/data/extensions/api_test/offscreen_tabs/test.html b/chrome/test/data/extensions/api_test/offscreen_tabs/test.html
deleted file mode 100644
index 46f4d74..0000000
--- a/chrome/test/data/extensions/api_test/offscreen_tabs/test.html
+++ /dev/null
@@ -1 +0,0 @@
-<script src="test.js"></script>
diff --git a/chrome/test/data/extensions/api_test/offscreen_tabs/test.js b/chrome/test/data/extensions/api_test/offscreen_tabs/test.js
deleted file mode 100644
index 8d065ee..0000000
--- a/chrome/test/data/extensions/api_test/offscreen_tabs/test.js
+++ /dev/null
@@ -1,364 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// OffscreenTabs API test
-// browser_tests.exe --gtest_filter=ExperimentalApiTest.OffscreenTabs
-
-var pass = chrome.test.callbackPass;
-var fail = chrome.test.callbackFail;
-var assertEq = chrome.test.assertEq;
-var assertTrue = chrome.test.assertTrue;
-
-var extensionPath =
- location.href.substring(0, location.href.lastIndexOf("/") + 1);
-
-var inTabs = [
- {
- "url": extensionPath + "a.html",
- "width": 200,
- "height": 200
- },
- {
- "url": extensionPath + "b.html",
- "width": 200,
- "height": 200
- },
- {
- "url": extensionPath + "c.html",
- "width": 1000,
- "height": 800
- }
-];
-
-// Tab Management (create, get, getAll, update, remove)
-var tabs = [];
-
-// Mouse (sendMouseEvent)
-var tabMouse = new Object();
-
-var mouseEvent = {
- "button": 0,
- "altKey": false,
- "ctrlKey": false,
- "shiftKey": false
-};
-
-var x = 11;
-var y = 11;
-
-// Keyboard (sendKeyboardEvent)
-
-var tabKeyboard = new Object();
-
-// Display (toDataUrl)
-
-var tabsCaptured = [];
-
-var nTabsCaptured = 2;
-
-// Util
-
-function compareTabs(tabA, tabB) {
- assertEq(tabA.id, tabB.id);
- assertEq(tabA.url, tabB.url);
- assertEq(tabA.width, tabB.width);
- assertEq(tabA.height, tabB.height);
-}
-
-function sortTab(tabA, tabB) {
- return tabA.id - tabB.id;
-}
-
-function verifyTabDoesNotExist(tabId) {
- chrome.experimental.offscreenTabs.
- get(tabId, fail("No offscreen tab with id: " + tabId + "."));
-}
-
-// Tab Management (create, get, getAll, update, remove) ------------------------
-
-function startTabManagement() {
- var nCallbacksNotDone = inTabs.length;
-
- for (var i=0; i<inTabs.length; i++) {
- chrome.experimental.offscreenTabs.create(
- {
- "url": inTabs[i].url,
- "width": inTabs[i].width,
- "height": inTabs[i].height
- },
- pass(function() {
- var j = i;
- return function(tab) {
- tabs[j] = tab;
-
- nCallbacksNotDone--;
-
- if (nCallbacksNotDone == 0)
- getAll();
- }
- }())
- );
- }
-}
-
-function getAll() {
- chrome.experimental.offscreenTabs.getAll(pass(function(tabsResult) {
- assertEq(tabs.length, tabsResult.length);
-
- tabs.sort(sortTab);
- tabsResult.sort(sortTab);
-
- for (var i=0; i<tabs.length; i++)
- compareTabs(tabs[i], tabsResult[i]);
-
- get();
- }));
-}
-
-function get() {
- var comparedTab = tabs[0];
-
- chrome.experimental.offscreenTabs.get(comparedTab.id, pass(function(tab) {
- compareTabs(comparedTab, tab);
-
- update();
- }));
-}
-
-function update() {
- var replicatedTab = tabs[0];
-
- chrome.experimental.offscreenTabs.update(tabs[1].id,
- {
- "url": replicatedTab.url,
- "width": replicatedTab.width,
- "height": replicatedTab.height
- },
- pass(function(tab) {
- assertEq(replicatedTab.url, tab.url);
- assertEq(replicatedTab.width, tab.width);
- assertEq(replicatedTab.height, tab.height);
-
- remove();
- })
- );
-}
-
-function remove() {
- for (var i=0; i<nTabsCaptured; i++) {
- chrome.experimental.offscreenTabs.remove(tabs[i].id);
- verifyTabDoesNotExist(tabs[i].id);
- }
-}
-
-// Mouse (sendMouseEvent) ------------------------------------------------------
-
-function startMouseEvents() {
- chrome.experimental.offscreenTabs.onUpdated.addListener(listener =
- function (tabId, changeInfo, tab) {
- chrome.experimental.offscreenTabs.onUpdated.removeListener(listener);
-
- assertEq(inTabs[0].url, changeInfo.url);
- assertEq(inTabs[0].url, tab.url);
- assertEq(inTabs[0].width, tab.width);
- assertEq(inTabs[0].height, tab.height);
-
- tabMouse = tab;
-
- mouseClick();
- });
-
- chrome.experimental.offscreenTabs.create(
- {
- "url": inTabs[0].url,
- "width": inTabs[0].width,
- "height": inTabs[0].height
- });
-}
-
-function mouseClick() {
- chrome.experimental.offscreenTabs.onUpdated.addListener(listener =
- function(tabId, changeInfo, tab) {
- chrome.experimental.offscreenTabs.onUpdated.removeListener(listener);
-
- assertEq(tabMouse.id, tabId);
- assertEq(tabMouse.id, tab.id);
- assertEq(inTabs[1].url, changeInfo.url);
- assertEq(inTabs[1].url, tab.url);
- assertEq(tabMouse.width, tab.width);
- assertEq(tabMouse.height, tab.height);
-
- mouseWheel();
- });
-
- mouseEvent.type = "click";
- chrome.experimental.offscreenTabs.
- sendMouseEvent(tabMouse.id, mouseEvent, x, y);
-}
-
-function mouseWheel() {
- mouseEvent.type = "mousewheel";
- mouseEvent.wheelDeltaX = 0;
- mouseEvent.wheelDeltaY = -100;
- chrome.experimental.offscreenTabs.
- sendMouseEvent(tabMouse.id, mouseEvent, 0, 0, function(tab) {
- mouseDownUp();
- }
- );
-}
-
-function mouseDownUp() {
- chrome.experimental.offscreenTabs.onUpdated.addListener(listener =
- function(tabId, changeInfo, tab) {
- chrome.experimental.offscreenTabs.onUpdated.removeListener(listener);
-
- assertEq(inTabs[2].url, tab.url);
-
- chrome.experimental.offscreenTabs.remove(tabMouse.id);
- verifyTabDoesNotExist(tabMouse.id);
- });
-
- mouseEvent.type = "mousedown";
- chrome.experimental.offscreenTabs.
- sendMouseEvent(tabMouse.id, mouseEvent, x, y);
-
- mouseEvent.type = "mouseup";
- chrome.experimental.offscreenTabs.
- sendMouseEvent(tabMouse.id, mouseEvent, x, y);
-}
-
-// Keyboard (sendKeyboardEvent) ------------------------------------------------
-
-function startKeyboardEvents() {
- chrome.experimental.offscreenTabs.onUpdated.addListener(listener =
- function(tabId, changeInfo, tab) {
- chrome.experimental.offscreenTabs.onUpdated.removeListener(listener);
-
- tabKeyboard = tab;
-
- keyPress();
- });
-
- chrome.experimental.offscreenTabs.create(
- {
- "url": inTabs[0].url,
- "width": inTabs[0].width,
- "height": inTabs[0].height
- }
- );
-}
-
-function keyPress() {
- chrome.experimental.offscreenTabs.onUpdated.addListener(listener =
- function(tabId, changeInfo, tab) {
- chrome.experimental.offscreenTabs.onUpdated.removeListener(listener);
-
- assertEq(inTabs[1].url, tab.url);
-
- chrome.experimental.offscreenTabs.remove(tabKeyboard.id);
- verifyTabDoesNotExist(tabKeyboard.id);
- });
-
- var keyboardEvent = {
- "type": "keypress",
- "charCode": 113, // q
- "keyCode": 113,
- "altKey": false,
- "ctrlKey": false,
- "shiftKey": false
- };
-
- chrome.experimental.offscreenTabs.
- sendKeyboardEvent(tabKeyboard.id, keyboardEvent);
-}
-
-
-// Display (toDataUrl) ---------------------------------------------------------
-
-// In order to test that we don't get empty images back we can compare two
-// images that are supposed to be different. We only need to make sure the two
-// offscreen tabs have the same size (i.e. inTabs[0] and inTabs[1])
-function startDisplay() {
- var nCallbacksNotDone = nTabsCaptured;
-
- chrome.experimental.offscreenTabs.onUpdated.addListener(listener =
- function (tabId, changeInfo, tab) {
- tabsCaptured[nTabsCaptured - nCallbacksNotDone] = tab;
-
- nCallbacksNotDone--;
-
- if (nCallbacksNotDone == 0) {
- chrome.experimental.offscreenTabs.onUpdated.removeListener(listener);
-
- toDataUrl();
- }
- });
-
- for (var i=0; i<nTabsCaptured; i++) {
- chrome.experimental.offscreenTabs.create(
- {
- "url": inTabs[i].url,
- "width": inTabs[i].width,
- "height": inTabs[i].height
- }
- );
- }
-}
-
-function toDataUrl() {
- var nCallbacksNotDone = nTabsCaptured;
-
- for (var i=0; i<nTabsCaptured; i++) {
- chrome.experimental.offscreenTabs.toDataUrl(
- tabsCaptured[i].id,
- {"format": "png"},
- function(dataUrl) {
- var j = i;
- return pass(function(dataUrl) {
- assertEq('string', typeof(dataUrl));
- assertEq('data:image/png;base64,', dataUrl.substr(0,22));
-
- tabsCaptured[j].dataUrl = dataUrl;
-
- nCallbacksNotDone--;
-
- if (nCallbacksNotDone == 0) {
- // Compare the dataUrls
- assertTrue(tabsCaptured[0].dataUrl != tabsCaptured[1].dataUrl);
-
- for (var i=0; i<nTabsCaptured; i++) {
- chrome.experimental.offscreenTabs.remove(tabsCaptured[i].id);
- verifyTabDoesNotExist(tabsCaptured[i].id);
- }
- }
- })
- }()
- );
- }
-}
-
-// Run tests ------------------------------------------------------------------
-
-chrome.test.runTests([
- // Tab Management (create, get, getAll, update, remove)
- function tabManagement() {
- startTabManagement();
- },
-
- // Mouse (sendMouseEvent)
- function mouseEvents() {
- startMouseEvents();
- },
-
- // Keyboard (sendKeyboardEvent)
- function keyboardEvents() {
- startKeyboardEvents();
- },
-
- // Display (toDataUrl)
- function display() {
- startDisplay();
- }
-]);
-