glx-gears_Google Gears-也许所需的所有Rich Internet Application是本地存储和离线模式

glx-gears

glx-gears

Stunning move by Google today in the Rich Internet Application space. While most of us (myself included) are off debating Flash vs. Silverlight vs. Apollo vs. Whatever, Google introduces Google Gears...at technology all of the above (or none of the above) can utilize...

Google今天在Rich Internet Application领域取得了惊人的成就。 虽然我们大多数人(包括我自己)都在辩论Flash,Silverlight,Apollo和任何东西,但Google引入了Google Gears ...在上述所有技术(或以上都不是)中可以使用...

This is a huge move and is quite brilliant. In one seemingly innocuous move (and one tiny 700k (yes, 700K) download) Google is well positioned to get Google Docs, including Writely, Spreadsheet and Presentation, along with who knows what else, enabled for offline use. And the whole thing is Open Sourced via the New BSD License.

这是一个巨大的举措,非常出色。 Google采取了一项看似无害的举动(一小笔700k(是的,700K)下载),可以很好地获取Google Docs,包括Writely,Spreadsheet和Presentation,以及谁知道其他什么,可以离线使用。 整个过程都是通过新的BSD许可证开源的

Here's a snippet of Javascript that is used to detect if Google Gears in installed. Note the three (currently) different ways, one each for Firefox, IE and Safari.

这是一段Javascript,用于检测是否已安装Google Gears。 请注意三种(当前)不同的方式,每种方式分别适用于Firefox,IE和Safari。

 var factory = null;

  // Firefox
  if (typeof GearsFactory != 'undefined') {
    factory = new GearsFactory();
  } else {
    // IE
    try {
      factory = new ActiveXObject('Gears.Factory');
    } catch (e) {
      // Safari
      if (navigator.mimeTypes["application/x-googlegears"]) {
        factory = document.createElement("object");
        factory.style.display = "none";
        factory.width = 0;
        factory.height = 0;
        factory.type = "application/x-googlegears";
        document.documentElement.appendChild(factory);
      }
    }
  }

To the right is a dialog box that pops up to let you know that Google Gears is going to store data locally. Gears uses SQLite to store information, and you use SQL from your JavaScript to CRUD (Create, Read, Update, Delete) your data. I wonder how would would store data securely?

右侧是一个对话框,弹出该对话框,让您知道Google Gears将在本地存储数据。 Gears使用SQLite来存储信息,并且您可以使用JavaScript中SQL来对数据进行CRUD(创建,读取,更新,删除)。 我想知道如何安全地存储数据

If you like, you can explore the databases that are created using SQLite Database Browser. This starts to explain why SQLite was a 2005 Google Open Source Award Winner. ;)

如果愿意,可以浏览使用SQLite Database Browser创建的数据库。 这开始解释了为什么SQLite成为2005年Google Open Source奖的获得者。 ;)

The local storage shows up when running Internet Explorer on Windows under:

在Windows上运行Internet Explorer时,在以下位置显示本地存储:

C:\Users\Scott\AppData\LocalLow\
Google\Google Gears for Internet Explorer\
www.yourdomain.com\http_80

C:\ Users \ Scott \ AppData \ LocalLow \ Google \ Google Gears for Internet Explorer \ www.yourdomain.com \ http_80

Within Firefox, the local storage databases go in:

在Firefox中,本地存储数据库进入:

...\Application Data\Mozilla\Firefox\Profiles\
<profile>\Google Gears for Firefox

... \ Application Data \ Mozilla \ Firefox \ Profiles \ <profile> \ Firefox的Google Gears

So it seems I can't go to a Gears-enabled site in IE and later in Firefox and share data. Each browser gets it's own data storage. That means num of browsers * num of gears enabled uris = num of SQLite databases. For folks who run more than one browser, this makes the whole local storage thing a tricky issue, but I can understand why they'd segment databases by browser. I disagree, but I see their point of view.

因此,看来我无法在IE中访问启用了Gears的网站,而后又无法Firefox中访问数据。 每个浏览器都有自己的数据存储。 这意味着浏览器数量*启用的齿轮数量uris = SQLite数据库数量。 对于运行多个浏览器的人们来说,这使整个本地存储成为一个棘手的问题,但是我可以理解为什么他们要按浏览器对数据库进行细分。 我不同意,但我看到了他们的观点。

Gears also includes a thread pool "tiny process pool" like construct that lets you perform CPU-intensive things without triggering the "Stop unresponsive script" dialog box, but you can't touch the DOM. Again, very cool and very intelligent tradeoffs.

Gears还包括一个类似于构造的 线程池 “微小进程池”,该 线程池 使您无需触发“停止无响应脚本”对话框即可执行占用大量CPU资源的事情,但是您无法触摸DOM。 同样,非常酷和非常明智的权衡。

Things are looking up, methinks. It'd be nice if Gears-like (Gearsesque?) functionality could get built into next-gen browsers the way that XmlHttpRequest did. Seems like only yesterday I was deep in the middle of the Great Cookie Scare of 1995, explaining to client what Cookies were...NO, they can't write out a megabyte sized cookie, no cookies aren't programs...glad that's over. If we've going to build some rich stuff, let's stop with the Flash Shared Objects and IsolatedStorage already and get the browser to solve this problem. Kudos for Google and let's pray there's no offline ads...

方法正在寻找,methinks。 如果可以像XmlHttpRequest那样将类似Gears的(齿轮)功能嵌入到下一代浏览器中,那就太好了。 好像直到昨天,我才陷入1995年的“大饼干恐慌”中,向客户解释什么是饼干...不,他们不能写出兆字节大小的Cookie,没有Cookie并不是程序...很高兴结束了。 如果我们要构建一些丰富的东西,让我们先停止Flash Shared ObjectsIsolatedStorage,然后让浏览器解决此问题。 恭喜Google,让我们祈祷没有离线广告...

翻译自: https://www.hanselman.com/blog/google-gears-maybe-all-rich-internet-applications-needed-was-local-storage-and-an-offline-mode

glx-gears

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值