Firefox / FireStorage Plus中的localForage setItem / getItem不可靠 [英] localForage setItem/getItem unreliable in Firefox / FireStorage Plus

查看:271
本文介绍了Firefox / FireStorage Plus中的localForage setItem / getItem不可靠的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在加载localForage的一个本地实例,并使用Promise链来保存基本数据。一个简单的例子:
$ b $ pre $ lt; code> localforage.getItem(sellerExtension)。then(function(sellerExtension){
if( (sellerExtension)||(sellerExtension.length< 3)){
var sellerExtension = $('input#sellerExtension').val();
if((sellerExtension)&& (){
localforage.setItem('sellerExtension',sellerExtension).then(function(){

});
}
}
});

当我进入FF开发工具来检查FireStorage Plus时,问题出现了。并没有看到任何关于保存/设置的数据。但我在Chrome中就好了。应该有几个保存的项目。



我一直在替换localStorage(仅适用于Firefox ugh),而且有些困惑为什么自己的包装器在这个FF特定扩展中没有显示用于访问本地数据库实例。它显示了键,getItem,清​​除所有,但是。

任何想法,为什么发生这种情况?我相信,我完全期望看到一些东西,并且正在寻找正确的位置。 (下面的截图)它似乎也没有加载.getItem请求的数据。



我正在使用一些AJAX访问处理localForage的子目录中的其他文件,但在同一个域/端口上。我能以某种方式在另一个范围内工作吗?如何知道?



感谢您的帮助!



但是在FF中没有列出任何范围...

解决方案

扩展如Firestorage Plus!和simplesession是不可靠的,当查找与localForage设置的数据!关键(双关意图)是使用Firefox内置的Inspector。

在添加扩展后我无法在我的FF中找到它,但是我有FF Dev Edition ,运行,启用配置选项中的存储工具,和巴姆,那里他们都是!希望这可以帮助别人。



我相信,如果你在不同的页面/文件上设置数据,那些扩展不会看到这些值,只有orginial文件/页面的getItem数据。




I am loading a local instance of localForage and using it with Promise chains to save basic data. A simple example:

localforage.getItem("sellerExtension").then(function(sellerExtension) {
if ((!sellerExtension)  || (sellerExtension.length < 3)) {
    var sellerExtension = $('input#sellerExtension').val();
    if ((sellerExtension)  && (sellerExtension.length > 3)) {
        localforage.setItem('sellerExtension', sellerExtension).then( function() {

        });
    }
} 
});

The problem comes when I go into the FF Dev-Tools to check FireStorage Plus! and see nothing related to the saved/set data. BUT I do in Chrome just fine. There should be several saved items.

I'd been replacing localStorage (just for Firefox ugh) and am somewhat perplexed why thier own wrapper isn't showing in this FF specific extension for accessing the local DB instances. It shows key, getItem, clear and all, however.

Any ideas why this is happening? I fully expected to see something, and am looking in the right spot, I believe. (Screenshot below) It doesn't seem to be loading the data from a .getItem request, either.

I am using some AJAX to access other files in a sub-directory which handles localForage, but am on the same domain/port. Could I somehow be working in another scope? How would I know?

Thanx MUCH for any assistance!

And in Chrome I see it all...

BUT not in FF in any of the Scopes listed...

解决方案

Extensions like Firestorage Plus! and simplesession are NOT reliable when looking for data being set with localForage!!! The key (pun intended) is to use the Firefox built-in Inspector.

I could NOT find this in my FF after adding extensions, but I had the FF Dev Edition, ran that, enabled the Storage tool in config options, and bam, there they ALL were!! Hope this helps someone else out.

I "believe" that if you set data on a different page/file, those extensions wont see these values, only the orginial file/page's getItem data.

这篇关于Firefox / FireStorage Plus中的localForage setItem / getItem不可靠的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆