| Index: chrome/common/extensions/docs/examples/extensions/storage_api_devtools/storage/inspectedWindow/detectStorage.js
|
| ===================================================================
|
| --- chrome/common/extensions/docs/examples/extensions/storage_api_devtools/storage/inspectedWindow/detectStorage.js (revision 0)
|
| +++ chrome/common/extensions/docs/examples/extensions/storage_api_devtools/storage/inspectedWindow/detectStorage.js (revision 0)
|
| @@ -0,0 +1,25 @@
|
| +// Copyright 2013 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.
|
| +
|
| +// detectStorage.js
|
| +// SYNCHRONOUS
|
| +// Check availability of chrome.storage API and
|
| +// return the result as a boolean.
|
| +
|
| +(function() {
|
| + function checkStorageArea(area) {
|
| + return area.get && area.set && area.remove && area.clear &&
|
| + area.getBytesInUse;
|
| + }
|
| +
|
| + function checkStorage() {
|
| + return chrome && chrome.storage && chrome.storage.onChanged &&
|
| + chrome.storage.local && chrome.storage.sync &&
|
| + checkStorageArea(chrome.storage.local) &&
|
| + checkStorageArea(chrome.storage.sync);
|
| + }
|
| +
|
| + return checkStorage() ? true : false;
|
| +})();
|
| +
|
|
|
| Property changes on: chrome/common/extensions/docs/examples/extensions/storage_api_devtools/storage/inspectedWindow/detectStorage.js
|
| ___________________________________________________________________
|
| Added: svn:eol-style
|
| + LF
|
| Added: svn:mime-type
|
| + text/javascript
|
|
|
|
|