Go to comments ↓ Home » 资源分享

自动备份输入框内容:Textarea Backup Localstorage

operaTextarea Backup Localstorage是能够帮你自动保存文本框数据的脚本。
预防因为误操作和网络问题提交不了评论等情况造成的数据丢失等问题。刷新和离开当前页面或者重启浏览器,你输入的文字都还能重新出现。这是一个杀手级的脚本。

这和之前介绍过一个Textarea Backup脚本作用基本相同。 不同之处在于数据是保存在Local storage(html5本地存储)中的不写cookies,不会出现单个站点cookies达到浏览器限制而丢失一些登录信息等问题。

Textarea Backup Localstorage

textarea backup localstorage的特点

  1. 支持自动恢复文本框数据。
  2. 数据是保存在Local storage(html5本地存储)中的,不写cookies
  3. 拥有可视化操作菜单(通过文本框右上角的按钮呼出):还原以前备份的评论,删除以前的备份评论,清除评论。
  4. 还能多个可自定义的选项:设置何时触发备份(自定义时间、键盘动作、提交的时候、光标移除文本框)、文本框内容、覆盖询问、数据过期时间等。

A.shun这就不再对OperaUserJS功能和FF的GreaseMonkey做介绍了,反正使用很简单。

Textarea Backup脚本

textarea-backup-localstorage.user.js下载

来自:extendopera.org

作者:Frenzie

下载:http://extendopera.org/userjs/content/textarea-backup-localstorage

感谢oc的版主DJ的推荐,威武~ 。这是在Textarea Backup和Textarea Backup with expiry的基础上做出改进而来的。

仅适用于Opera10.5和Firefox3.6、Chrome5(未测试)以上版本等支持 用户脚本和localstorage的浏览器。
Tips:Opera10.52用户可以在operaconfigopera:webstorage中管理离线数据和进行一些站点设置。在新版本的浏览器中,Textarea Backup已经可以被取代了。

Textarea Backup Localstorage自定义设置

可以自定义的地方还是蛮多的。 A.shun对js不是太了解,这里只介绍几个常用的选项。如有不对的请指正。
用编辑器打开js文件。找到Preferences段。修改各项等号后面的内容即可,基本上使用布尔字符和数字。

  • menu_display,是否显示菜单,默认显示
  • keypress_backup,有按键动作时备份,默认开启
  • blur_backup,焦点离开文本框时备份,默认开启
  • timed_backup,定时备份,默认关闭
  • backup_interval,备份间隔,默认为1000毫秒
  • keep_after_submission,提交时保存
  • restore_auto,自动恢复文本框内容,默认启用。
  • ask_overwrite,覆盖前询问,默认启用
  • em_available,这个我还不是太明白。只有当自动恢复被禁用时,此选项才有效。
  • expire_after_days/expire_after_hours/expire_after_minutes,数据过期时间,默认为2小时30分。全部设置为0则不计算过期时间。

» 转载请以超链接形式注明来源:A.shun Blog » 《自动备份输入框内容:Textarea Backup Localstorage》
» 本文链接地址:http://shun.im/21349

» 本文采用 BY-NC-SA 协议进行授权。
» 建议通过 Rss( Feedly | Feedburner | Feedsky )方式及时获取更新。
  1. 坐在沙发上看。 😆

    Opera 10.51 Opera 10.51 Windows 7 Windows 7
    #1
    @
    • @Vicia 这个看起来真复杂,以前那个用起来不错,这个也试试看。
      之前那个的cookie问题啥的我好像没遇到。

      Opera 10.51 Opera 10.51 Windows 7 Windows 7
    • @Vicia 以前那个也是有选项的,只是没去研究。
      你也可以不设置啊,直接丢进去

      Opera 10.52 Opera 10.52 Windows XP Windows XP
  2. 是的,有时候还真的会遇到这种因为网络问题提交不成功,造成数据丢失的问题。这个绝杀之道一定要学来用用。

    Internet Explorer 7.0 Internet Explorer 7.0 Windows XP Windows XP
    #2
    @
    • @365hope 是的,以前也用着Textarea Backup ,但是写文章有时候要丢cookies,这个则没有问题

      Opera 10.52 Opera 10.52 Windows XP Windows XP
  3. 果然是杀手级的…

    Firefox 3.6.3 Firefox 3.6.3 Windows 7 Windows 7
    #3
    @
  4. 世纪之光

    这功能挺好的,有时候我页面跳转后再回退回去,文本框里面的内容还是存在的。

    Google Chrome 4.1.249.1045 Google Chrome 4.1.249.1045 Windows 7 Windows 7
    #4
    @
    • @世纪之光 对于op来说,后退不需要脚本,内容也还在。
      这个可以在刷新甚至退出浏览器继续保留

      Opera 10.52 Opera 10.52 Windows XP Windows XP
  5. 这个相当强大

    Maxthon 2.0 Maxthon 2.0 Windows XP Windows XP
    #5
    @
  6. 这个不错,以前用的一个脚本重启浏览器后内容就丢失了,这下不用怕崩溃了。

    Opera 10.51 Opera 10.51 Windows 7 Windows 7
    #6
    @
  7. 强,这个版本考虑周到,线下测试先。特别是留言的时候,各浏览器不兼容丢失严重。

    Internet Explorer 7.0 Internet Explorer 7.0 Windows XP Windows XP
    #7
    @
  8. 很强大,由于网络/主机问题总是会遇到评论失败,很实用的功能。这次是op和ff通用,很好很大腿

    Opera 10.51 Opera 10.51 Windows 7 Windows 7
    #8
    @
  9. 呃…这也能备份…强大…

    Firefox 3.6.3 Firefox 3.6.3 Windows 7 Windows 7
    #9
    @
  10. 这是使用在自己浏览器上的还是说部署在服务器上。。?

    Firefox 3.6.3 Firefox 3.6.3 Windows 7 Windows 7
    #10
    @
    • @QiQBoY 当然是浏本地览器啊,能对几乎所有常见的站点有效。
      天哪,居然不用GreaseMonkey。。我认为这是FF下最好的扩展,没有之一

      Opera 10.52 Opera 10.52 Windows XP Windows XP
  11. 收藏下咯

    TheWorld Browser TheWorld Browser Windows XP Windows XP
    #11
    @
  12. wp是有这个功能的哇?

    Firefox 3.6.3 Firefox 3.6.3 Windows XP Windows XP
    #12
    @
  13. 这个Firefox下面有个Textarea Cache扩展 我一直在用的

    Firefox 3.5.9 Firefox 3.5.9 Windows 7 Windows 7
    #13
    @
  14. 但数据丢失实在是小概率事件,你还真是挑剔

    Google Chrome 5.0.342.7 Google Chrome 5.0.342.7 GNU/Linux GNU/Linux
    #14
    @
    • @yun77op 看来同学不怎么在博客评论或者逛论坛啊,由于网络和程序问题出现的概率也不是很低。
      再说了,这个需求还是很多的,小众、可能吧他们都介绍过类似的脚本。

      Opera 10.52 Opera 10.52 Windows XP Windows XP
  15. 如果用当年的那个频频出问题的主机的时候能够用到这个,访客们就不会太郁闷了~
    因为很多人精心写了很多,但是最后却都没有了

    Maxthon 2.0 Maxthon 2.0 Windows 7 Windows 7
    #15
    @
  16. 这个功能不错,有些WP留言老是出错,这样好多了

    Firefox 3.6.3 Firefox 3.6.3 Windows 7 Windows 7
    #16
    @
  17. 如果是HTML5的Local Storge的话,IE8可以靠边站了 😆

    Safari 4.0.5 Safari 4.0.5 Mac OS X 10.6.3 Mac OS X 10.6.3
    #17
    @
  18. 呵呵,这个常遇到!太囧了

    Firefox 3.6.3 Firefox 3.6.3 Windows 7 Windows 7
    #18
    @
  19. 这个不错

    Firefox 3.6.3 Firefox 3.6.3 Windows XP Windows XP
    #19
    @
  20. 手动备份的路过…

    Opera 10.10 Opera 10.10 Windows XP Windows XP
    #20
    @
  21. 挺有用。不过HTML5很多浏览器不支持啊。

    欢迎各位站长加入交流群:45339145 , 前来观摩指导、分享交流

    Google Chrome 4.1.249.1045 Google Chrome 4.1.249.1045 Windows XP Windows XP
    #21
    @
  22. ➡ chrome再后退的时候貌似也可以做到保留输入框文本

    Google Chrome 5.0.366.2 Google Chrome 5.0.366.2 Windows 7 Windows 7
    #22
    @
  23. 这个功能是很不错的

    Firefox 3.6.3 Firefox 3.6.3 Windows 7 Windows 7
    #23
    @
  24. 没有 for FF的,有时候,写长的评论我都是会copy在发布的

    Firefox 3.6.3 Firefox 3.6.3 Windows 7 Windows 7
    #24
    @
  25. 我总是没耐心看跟代码有关的东西。
    咋办。

    TheWorld Browser TheWorld Browser Windows 7 Windows 7
    #25
    @
    • @Stefana 这个直接丢浏览器可以用,跟代码无关。
      不过很遗憾,不正常IE。。。

      Opera 10.52 Opera 10.52 Windows XP Windows XP
  26. 😀 挺好的,就是不知道怎么用。

    Internet Explorer 8.0 (Compatibility Mode) Internet Explorer 8.0 (Compatibility Mode) Windows XP Windows XP
    #26
    @
  27. 哇..都成Opera折腾大人了 😀

    Google Chrome 5.0.371.0 Google Chrome 5.0.371.0 Windows XP Windows XP
    #27
    @
  28. 啊,这个蛮有用的哇,特别遇到是打了一大堆文字提交不成功的时候 :roll:

    Google Chrome 5.0.371.0 Google Chrome 5.0.371.0 Windows 7 Windows 7
    #28
    @
    • @Jutoy 恩,据上面的卜卜口の同学测试,在chrome5下也可以正常工作

      Opera 10.52 Opera 10.52 Windows XP Windows XP
  29. 这个功能很不错,每次丢失相当的抓狂啊

    Firefox 3.5.7 Firefox 3.5.7 Windows XP Windows XP
    #29
    @
  30. 这个好 马上换掉 Textarea Backup :roll:

    Opera 10.52 Opera 10.52 Windows Server 2003 Windows Server 2003
    #30
    @
  31. 目前主攻Chrome!和Firefox

    TheWorld Browser TheWorld Browser Windows XP Windows XP
    #31
    @
  32. html5,普及尚早;我记得有个项目AMASS是用利用flash存储大量数据到本地的,不过已经撤下了

    Google Chrome 5.0.342.9 Google Chrome 5.0.342.9 GNU/Linux GNU/Linux
    #32
    @
  33. 十寸甫

    这个脚本怎么应用呀
    我不会应用
    您说的拥有可视化操作菜单(通过文本框右上角的按钮呼出)在哪里?我怎吗找不到呀

    Firefox 4.0 Firefox 4.0 Windows XP Windows XP
    #33
    @
    • @十寸甫 我也不知道这个脚本在 FX4 下表现如何。
      还有那个按钮有时候会有错位。。。

      Opera 11.10 Opera 11.10 Windows XP Windows XP
  34. I love it when folks get together and share thoughts.
    Great website, stick with it!

    Feel free to visit my web site; เกร็ดความรู้

    Firefox 114.0 Firefox 114.0 Ubuntu Ubuntu
    #34
    @
Leave a Reply to Vicia

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

点击这里取消回复。