2009年10月11日日曜日

ChromiumでlocalStorageを動かす方法ChromiumではlocalStorageがどうにも動かない

参考ページ
端末からの起動オプションに「--enable-local-storage」をつける
$ chromium-browser --enable-local-storage
  window.addEventListener("click", function(){
localStorage.key1 = "value1";
alert(localStorage["key1"]);
}, true);


原文:In the current dev release there is no support for events nor for quotas. Event support should land by 9/30, with quotas landing by 10/9. The goal is to remove the flag by mid October on dev channel, and include this feature in the 4.0 launch.
和訳:9/23/2009現在、開発版ではevent,quotasはサポートしていない。eventは9/30,quotasは10/9頃にサポートされ、10月中旬には起動フラグがなくなる。(ここから確信が無い)これらの変更はversion4.0以降にも含まれる。

もうちょっと待つとデフォルトでlocalStorage使えるようになる(予定)ということだろうか。

FirefoxのlocalStorage的なやつで気分転換する。
参考ページ
最新版を使っていれば本物のlocalStorageを使えるみたいだがFirefox3.5でないのでこちらで我慢する。
var ls = {
init: function(){
window.addEventListener("load", function(){
globalStorage['localhost'].visits =
parseInt( globalStorage['localhost'].visits || 0 ) + 1;
alert(globalStorage['localhost'].visits);
}, true);
}
}

ls.init();

Chromiumが悪いのかWebkitが悪いのかどちらなんだろうか?

0 件のコメント:

コメントを投稿