Firefox 中的 WebSQL

发布于 2024-12-15 16:14:43 字数 433 浏览 3 评论 0原文

我今天正在查看一个greatmonkey 脚本,试图找出它不再起作用的原因。玩了一段时间后,我意识到它在 Firefox 3.6 上运行良好,但在当前版本 (8) 等更高版本上运行不佳。

经过一番谷歌搜索后,我到达了这里

我不确定我是否正确地阅读了这篇文章。 WebSQL 被从 Firefox 中删除完全是因为标准化进程已经陷入“僵局”,因为除了 SQLite 之外没有替代的实现?这是否意味着依赖 WebSQL 的 Greasemonkey 脚本需要 ff 3.6 才能正常运行?

我想知道简单地将 SQLite 分叉为 NotSQLite 并继续标准化过程可能有多困难......

I was looking at a greasemonkey script today trying to figure out why it wasn't working any more. After playing around a while I realized it worked fine on firefox 3.6 but not on later versions like the current one (8).

After a bit of googling I landed here.

I'm not sure if I'm reading this correctly. WebSQL is being dropped from Firefox entirely because the standardization process has reached an "impasse", because there is no alternative implementation except for SQLite? Does this mean greasemonkey scripts that rely on WebSQL require ff 3.6 to run properly?

I wonder how hard it might be to simply fork SQLite into NotSQLite and have the standardization process continue...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

待"谢繁草 2024-12-22 16:14:43

Firefox 并没有自己砍掉 WebSQL;而是自己砍掉了 WebSQL。 W3C 已宣布其死亡

请注意,Firefox 仍然使用 SQLite,这与 WebSQL 不同。但是,Greasemonkey 脚本无法直接访问 SQLite。

您可以使用 sessionStorage、localStorage 和/或 globalStorage 来保存值。

或者您可以使用 IndexedDB,它是 WebSQL 的替代品。

最后,对于完整的 SQL 功能,有旧标准 AJAX 数据来回传输到您自己的服务器

显然,由于缺乏持续的支持以及安全漏洞的确定性不断增加,继续使用 FF 3.6 并不是一个好主意。

Firefox didn't axe WebSQL by themselves; the W3C has declared it dead.

Note that Firefox still uses SQLite, which is not the same as WebSQL. However, a Greasemonkey script does not have direct access to SQLite directly.

You can use sessionStorage, localStorage, and/or globalStorage to persist values.

Or you can use IndexedDB which is the replacement for WebSQL.

Finally, for full-on SQL capabilities, there is the old standard of AJAXing data back and forth to your own server.

Obviously, it's not a good idea to remain on FF 3.6, due to lack of ongoing support, and increasing certainty of security exploits.

等往事风中吹 2024-12-22 16:14:43

您可能有兴趣注意到 Firefox 中的 SQLite 有一个新选项 - SQL.js。这是一个使用 Emscripten 创建的 JavaScript 库,用于将原始 C 代码转换为可运行的 JavaScript。您可以将整个 SQLite 环境加载到 Firefox(或 Chrome、Safari 或 IE10)中,并在内存中创建新数据库。如果您需要保留某些内容,这可能有点棘手,但您可以根据需要将数据写入 localStorage。

如果您想查看此代码的实际效果,可以在此处查看:http:// sqlfiddle.com/#!5/781d4/2

如果您想将它与 WebSQL 进行比较,您也可以在 SQL Fiddle 上进行:http://sqlfiddle.com/#!7/04eca/1 (显然仅适用于支持WebSQL)。

完全披露 - sqlfiddle.com 是我的网站。您可能对我为 SQL.js 编写的一些接口代码感兴趣 - 请在此处查看:https://github.com/jakefeasel/sqlfiddle/blob/master/javascripts/sqljs_driver.js

You might be interested in noting that there is a new option for SQLite in Firefox - SQL.js. This is a JavaScript library that was created using Emscripten to translate the original C code into runnable JavaScript. You can load the entire SQLite environment into Firefox (or Chrome or Safari or IE10) and create a new database within memory. If you need to persist things, that might be a bit tricky, but you could probably write your data out to localStorage as needed.

If you'd like to see this code in action, you can check it out here: http://sqlfiddle.com/#!5/781d4/2

And if you'd like to compare it with WebSQL, you can do that at SQL Fiddle too: http://sqlfiddle.com/#!7/04eca/1 (obviously only for browsers which support WebSQL).

Full disclosure - sqlfiddle.com is my site. You may be interested in some of the interface code I wrote for SQL.js though - see it here: https://github.com/jakefeasel/sqlfiddle/blob/master/javascripts/sqljs_driver.js

夏日浅笑〃 2024-12-22 16:14:43

我来晚了一点,但为了防止其他人偶然发现这个问题,我为 Firefox 创建了一个附加组件,以使用内置的 SQLite 支持来证明 WebSQL 函数
https://addons.mozilla.org/en- US/firefox/addon/html5-websql-for-firefox/

I'm a bit late to the party, but in case anyone else stumbles across this question I've created an add-on for Firefox to use the built-in SQLite support to prove WebSQL functions
https://addons.mozilla.org/en-US/firefox/addon/html5-websql-for-firefox/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文