我在linux上,所以现在没有办法测试这个,但是有问题的文件没有存储在浏览器缓存中,而是存储在
注意:从 IE 10 开始,这不再成立。参考。编辑下面的 2。
W7+: %HOMEPATH%\AppData\Roaming\Microsoft\Internet Explorer\UserData
# c:\users\*user-name*\...
XP : %HOMEPATH%\Application Data\Microsoft\Internet Explorer\UserData
# c:\Documents and Settings\*user-name*\...
或者,我想,这个也可以(作为捷径),:
%APPDATA%\Roaming\Microsoft\Internet Explorer\UserData
修改或删除那里的文件。
请注意,这些文件被标记为受保护的操作系统文件,因此要在资源管理器中查看,您必须更改视图以包含这些文件。如果您使用cmd
,如在命令提示符中,则必须包含以下/a
标志:
dir /a
编辑1:
请注意,该 index.dat 是一个保存有关分配大小等信息的文件,因此它不会(可能)仅帮助删除/移动 xml 文件。
编辑2:
好的。在运行 IE 10 的 Windows 7 中查看了这个。
在 IE 7(在 XP 上)中,上述路径有一个index.dat
文件在保存时更新为userData
. 该文件包含各种信息,例如索引文件的大小、子文件夹的数量、所有文件的大小。然后为每个文件添加一个条目,其中包含一个数字标识文件夹、保存它的 url、xml 文件的名称、日期等。为此编写了一个简单的 VBScript 解析器,但由于 IE 10 不使用该index.dat
文件,所以这是一种浪费。
在 IE 10 下不再有各种index.dat
文件,而是一个中央数据库文件:
%APPDATA%\Local\Microsoft\Windows\WebCache\
在我的系统上,数据库文件名为WebCacheV01.dat
,该V
部分似乎在系统之间有所不同,并且可能是内部版本号而不是文件类型版本。
这些文件被紧紧锁定,因此,如果想戳它们,一种解决方案是使用vscsc、Shadowcopy等工具制作卷影副本。
无论如何,黑客WebCacheVxx.dat
需要更多的工作,所以我没有尝试(至少现在)。
但是,注册该文件会获得一个带有旧位置路径的条目- 例如,在写入时someElement.save("someStorageName");
,WebCacheVxx.dat
会获得一个类似的条目:
...\AppData\Roaming\Microsoft\Internet Explorer\UserData\DDFFGGHH\someStorageName[1].xml
并在上述路径中创建相应的文件。
但是,本地container.dat
没有更新。
用户数据
至于手头的问题,清除localStorage
将无济于事,因为userData
它不是该 API 的一部分。
找不到关于如何清除的好例子userData
。不过,一种方法是使用控制台。
此页面上的测试示例:
- 保存一些文本。
点击F12并输入以下内容以清除数据:
/* ud as an acronym for userData */
var i, at,
ud_name = "oXMLBranch",
ud_id = "oPersistText",
ud = document.getElementById(ud_id);
/* To modify the storage one have to ensure it is loaded. */
ud.load(ud_name);
/* After load, ud should have a xmlDocument where first child should hold
* the attributes for the storage. Attributes as in named entries.
*
* Example: ud.setAttribute("someText", "Some text");
* ud.save(ud_name);
*
* XML-document now has attribute "someText" with value "Some text".
*/
at = ud.xmlDocument.firstChild.attributes;
/* Loop attributes and remove each one from userData. */
for (i = 0; i < at.length; ++i)
ud.removeAttribute(at[i].nodeName);
/* Finally update the file by saving the storage. */
ud.save(ud_name);
或作为单行:
var ud_name = "oXMLBranch", ud_id = "oPersistText", i, at, ud = document.getElementById(ud_id); ud.load(ud_name); at = ud.xmlDocument.firstChild.attributes; for (i = 0; i < at.length; ++i) ud.removeAttribute(at[i].nodeName); ud.save(ud_name);
消除一项限制
这有一些问题。ud_id
我们可以通过忽略并创建一个新的 DOM 对象来消除至少一个:
var i, at,
ud_name = "oXMLBranch",
ud = document.createElement('INPUT');
/* Needed to extend properties of input to include userData to userdata. */
ud.style.behavior = 'url(#default#userdata)';
/* Needed to not get access denied. */
document.body.appendChild(ud);
ud.load(ud_name);
at = ud.xmlDocument.firstChild.attributes;
for (i = 0; i < at.length; ++i)
ud.removeAttribute(at[i].nodeName);
/* Save, or nothing is changed on disk. */
ud.save(ud_name);
/* Clean up the DOM tree */
ud.parentNode.removeChild(ud);
所以通过这个应该能够通过知道存储名称来清除 userData,它应该与文件名(不包括[1].xml
)相同或通过查看页面源。
更多问题
在上面提到的页面上进行测试,我达到了disk is full
65,506 字节的限制。
您的问题可能不是磁盘已满,而是在输入数据超出限制的情况下进行了写入尝试。您可以尝试清除上面提到的数据,看看它是否继续,否则您需要清除即将写入的数据。
再一次,这很可能会破坏有问题的应用程序。
换句话说,错误文本应该是这样的:
NNN 字节的写入超过了 NNN 的限制,而不是磁盘已满。
通过附加到窗口进行测试,onerror
但不幸的是没有找到错误源:
var x1, x2, x3, x4 ;
window.onerror = function () {
x1 = window.event;
x2 = x1.fromElement; // Yield null
x3 = x1.srcElement; // Yield null
x4 = x1.type;
};
尾注
除非清除 userData方法解决了问题,否则我不知道下一步该去哪里。没有找到任何通过注册表或其他方式增加限制的选项。
但也许它能让你走得更远。
超级用户中可能有人可以提供帮助。