Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4984)

Unified Diff: chrome/common/extensions/docs/examples/extensions/storage_api_devtools/storage/inspectedWindow/detectStorage.js

Issue 12760009: Write a devtools extension to inspect chrome.storage data Base URL: https://src.chromium.org/svn/trunk/src/
Patch Set: small fixes Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698