【问题标题】:Using ExternalInterface on Chrome Extensions background page possible?可以在 Chrome 扩展后台页面上使用 ExternalInterface 吗?
【发布时间】:2010-12-15 09:48:51
【问题描述】:

可以在嵌入在 background.html 和 background.html 上的 SWF 之间使用 ExternalInterface 吗?

当 creationComplete 时,调用 ExternalInterface.call("alert", "test"),但没有任何反应。

当 background.html 作为文件打开时,它可以工作。

SWF 和 bacground.html 在同一个目录中。

SWF添加全局安全面板和flash.system.Security.allowDomain("*");

谷歌浏览器是最新版本。

【问题讨论】:

    标签: javascript actionscript-3 google-chrome google-chrome-extension externalinterface


    【解决方案1】:

    你必须为外部接口调用一个函数。

    试试:

    ExternalInterface.call("function setLocation() {alert("Hello!");}");
    

    或者在你的 background.html 上创建一个 js 函数来为你完成剩下的工作。

    【讨论】:

    • Flash Player 怎么样?如果你有 Pepper Flash,它可能是问题的根源。
    猜你喜欢
    • 2012-10-30
    • 2015-11-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-04
    相关资源
    最近更新 更多