firebreath插件更新后刷新 [英] firebreath plugin refresh after update

查看:63
本文介绍了firebreath插件更新后刷新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在更新后重新加载插件而不重启浏览器.我尝试了 mac 版本,它工作正常,但是,我需要为每个版本更改插件名称.

I want to reload a plugin after update without restarting browser. I tried the mac version, it works fine, howeve, I need to change the plugin name for each version.

navigator.plugins.refresh(false);

http://www.firebreath.org/display/documentation/Deploying+and+updating+your+plugin?focusedCommentId=8585308#comment-8585308

在 Windows 中,我尝试了这些步骤,但无法使其正常工作.有没有人有这方面的运气?有谁知道可能出了什么问题?

In windows, I tried those steps and I couldn't make it work. Has anyone had any luck with this? Does anyone know what could be wrong?

在 Windows 上,您甚至需要将其安装到具有特定版本文件名的特定版本目录.安装插件后,您可以尝试以下操作在打开的浏览器中重新加载插件

"On Windows you even need to install it to a version-specific directory with a version-specific filename. Once the plugin is installed, you can try the following to reload the plugin in open browsers

<script>
    var myplugin = "<object id=\"plugin\" type=\"application/x-foobar\"> </object>";
    function onload(){ // Assuming this function put your plugin on the page in the first place
        document.getElementById('pluginHere').innerHTML = myplugin;
    }
    function reload(){
        document.getElementById('pluginHere').innerHTML = "";
        document.getElementById('pluginHere').innerHTML = myplugin;
    }
</script>

非常感谢.

推荐答案

这是一个很困难的技巧,可能会以很多不同的方式出错.我很难猜测具体可能出了什么问题,特别是因为您说的是在 Windows 上",但您没有指定那是什么浏览器.所有浏览器都以微妙的方式工作,而 IE 和其他浏览器在这一点上完全不同.

This is a difficult trick that can go wrong in a lot of different ways. It's difficult for me to guess what might be going wrong specifically, particularly since you said "on windows", but you haven't specified what browser that is. All of the browsers work differently in subtle ways and IE and the others are completely different as far as this goes.

你可以尝试的事情:

  • 使用 setTimeout 在从 DOM 中删除插件和重新添加它之间添加一个小的延迟
  • 打开 about:plugins,然后通过 shift-refresh 来查看它是否选择了新版本
  • 尝试不同的浏览器,看看行为是什么
  • 使用 Process Monitor 监控注册表的查询并查看访问注册表项时;使用它来帮助您规划策略.
  • use setTimeout to add a small delay between removing the plugin from the DOM and re-adding it
  • open about:plugins and then shift-refresh to see if it picks up the new version
  • Try different browsers and see what the behavior is
  • Use Process Monitor to monitor the queries of the registry and see when the registry keys are being accessed; use this to help plan your strategy.

无论如何,我希望其中有一些帮助;我曾经以这种方式升级,但它太容易出错并且太容易随着新浏览器的变化而改变,所以现在我只是让客户端在升级时重新启动他们的浏览器.它节省了很多麻烦和很多的开发时间.

Anyway, I hope some of that helps; I used to upgrade that way but it was too error prone and too prone to things changing with new browsers, so these days I just make the client restart their browser on upgrades. It saves a lot of hassle and lots of development time.

这篇关于firebreath插件更新后刷新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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