简体   繁体   English

在Chrome扩展程序弹出窗口中保持Flash元素处于活动状态

[英]Keep Flash element active in Chrome Extension popup

I'm developing a Chrome extension and embedded a Flash IRC client on the popup page. 我正在开发Chrome扩展程序,并在弹出页面上嵌入了Flash IRC客户端。 The problem is, that it doesn't stay active, when the popup is hidden and restarts when the popup opens. 问题是,当弹出窗口被隐藏时它不会保持活动状态,而当弹出窗口打开时它会重新启动。 Is there a way to keep that element active? 有没有办法使该元素保持活动状态?

It doesn't have anything to do with using a Flash object, but with the way popups work in Chrome Extensions. 它与使用Flash对象无关,但与Chrome扩展程序中弹出窗口的工作方式无关。 The page in a popup (typically popup.html ) doesn't exist at all when the popup is closed, so your Flash object doesn't "live" anywhere. 当关闭弹出窗口时,弹出窗口中的页面(通常为popup.html )根本不存在,因此Flash对象不会在任何地方“存在”。 So basically, the popup isn't just "hidden", it's closed and stops running. 因此,基本上,弹出窗口不仅是“隐藏”的,而且已关闭并停止运行。

Sadly the documentation is not explicit about that. 遗憾的是,文档并未对此进行明确说明。

As far as I know, only the background page continues running at all times. 据我所知,只有后台页面始终在运行。 If you were able to communicate through JavaScript with the Flash object, you might be able to have the background page run the Flash and store the messages, and whenever the popup is open, the popup page and the background page could use message passing so that the popup can display the messages that happened while it was closed. 如果您能够通过JavaScript与Flash对象进行通信,则可以使后台页面运行Flash并存储消息,并且只要打开弹出窗口,弹出页面和背景页面就可以使用消息传递方式,弹出窗口可以显示关闭时发生的消息。 But that doesn't sound great. 但这听起来并不好。

Another alternative would be to open a popup window like we used to in the old days. 另一种选择是像以前一样打开一个弹出窗口。 :) :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM