Index: chrome/common/extensions/docs/examples/api/storage/stylizr/options.js |
diff --git a/chrome/common/extensions/docs/examples/api/storage/stylizr/options.js b/chrome/common/extensions/docs/examples/api/storage/stylizr/options.js |
index 82fa04f23b2d18c56ce5bd43994ff08adf616a3d..0832551357107930cb5c58ae693f1d7211aa55eb 100644 |
--- a/chrome/common/extensions/docs/examples/api/storage/stylizr/options.js |
+++ b/chrome/common/extensions/docs/examples/api/storage/stylizr/options.js |
@@ -33,6 +33,8 @@ function saveChanges() { |
function loadChanges() { |
storage.get('css', function(items) { |
+ // To avoid checking items.css we could specify storage.get({css: ''}) to |
+ // return a default value of '' if there is no css value yet. |
if (items.css) { |
textarea.value = items.css; |
message('Loaded saved CSS.'); |
@@ -41,7 +43,8 @@ function loadChanges() { |
} |
function reset() { |
- // Remove the saved value from storage |
+ // Remove the saved value from storage. storage.clear would achieve the same |
+ // thing. |
storage.remove('css', function(items) { |
message('Reset stored CSS'); |
}); |