从Firefox的缓存中读取脚本标签的来源 [英] Read the source of a script tag from the cache in Firefox

查看:67
本文介绍了从Firefox的缓存中读取脚本标签的来源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在向我的应用程序添加一些错误报告.我希望能够从一个类中报告方法名称,甚至认为该函数可能是匿名的.

I'm adding some error reporting to my application. I want to be able to report the method name from a class, even thought the function may be anonymous.

到目前为止,我的解决方案涉及通过将脚本标签加载到XmlHttpRequest来读取脚本标签的源代码.我的问题是Firefox无法从缓存加载,并且始终会调出服务器(chrome使用缓存,而我尚未在IE中启动).由于我的项目有数千行代码,因此向服务器发出第二个请求会花费不必要的时间.

So far my solution involves reading the source of the script tag by loading it with XmlHttpRequest. My problem is that Firefox will not load from cache and always calls out to the server (chrome uses the cache and I haven't started in IE yet). Since my project has thousands of lines of code, making a second request to the server takes unwanted time.

有人知道让Firefox检查缓存的方法吗?除此以外,是否有一种方法可以直接从script标签读取脚本源?还有其他方法可以获取我从未想到的资源吗?

Is anyone aware of a way to make Firefox check the cache? Barring that, is there a way to read the script source directly from the script tag? Is there some other way to get the source that I haven't thought of?

推荐答案

您是否考虑过针对Firefox提交错误?使用 bugzilla.mozilla.org . (如果它询问您要将错误提交到哪里,请使用产品:"Core",组件:"Networking:Cache".)

Have you considered filing a bug against Firefox? Use bugzilla.mozilla.org. (If it asks you where you want to file the bug, use Product: "Core", Component: "Networking: Cache".)

<script>与XHR的安全规则不同...但是,这实际上并不是Firefox跳过缓存的原因.

The security rules are different for <script> vs. XHR... but that's really no reason for Firefox to skip the cache.

这篇关于从Firefox的缓存中读取脚本标签的来源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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