【问题标题】:Listen to page save event in a Chrome extension and Firefox addon在 Chrome 扩展和 Firefox 插件中收听页面保存事件
【发布时间】:2011-09-26 11:11:56
【问题描述】:

我正在开发一个插件,在保存网页时需要通知。浏览 chrome 扩展 API 很久了,似乎找不到解决办法。

这样的事件是否存在,是否可以收听?

如果没有,Firefox 插件可以做到这一点吗?

【问题讨论】:

    标签: google-chrome firefox events firefox-addon add-on


    【解决方案1】:

    我认为 Chrome 插件无法实现。至于 Firefox - 当然,在 one of the include files 中定义的主浏览器窗口 (browser.xul) 中有一个 ID 为 Browser:SavePage<command> element。例如,您可以为此元素添加 command 事件的侦听器:

    document.getElementById('Browser:SavePage').addEventListener('command', function(e) {
        console.log('doing command', 'id:', e.target.id, 'e:', e);
    }, false);
    

    【讨论】:

      猜你喜欢
      • 2012-01-12
      • 2013-01-26
      • 1970-01-01
      • 2013-11-30
      • 2014-10-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多