OLD | NEW |
(Empty) | |
| 1 <script> |
| 2 // store some stuff in local storage |
| 3 localStorage.foo = "bar"; |
| 4 |
| 5 // store some stuff in a database |
| 6 var db = window.openDatabase("mydb2", "1.0", "database test"); |
| 7 db.transaction(function(tx) { |
| 8 tx.executeSql("drop table if exists note"); |
| 9 tx.executeSql("create table note (body text)", []); |
| 10 tx.executeSql("insert into note values ('hotdog')", []); |
| 11 }, function(error) { |
| 12 fail(error.message); |
| 13 }); |
| 14 |
| 15 // Open a tab. This doesn't really prove we're writing to disk, but it is |
| 16 // difficult to prove that without shutting down the process. We'll just |
| 17 // trust that if this next trick works, that the real testing for local |
| 18 // storage is good enough to catch more subtle errors. |
| 19 chrome.tabs.create({ |
| 20 url: "tab.html" |
| 21 }); |
| 22 </script> |
OLD | NEW |