【问题标题】:trying to use window.opener technique to call parent js function from child popup window?试图使用 window.opener 技术从子弹出窗口调用父 js 函数?
【发布时间】:2014-06-10 18:56:53
【问题描述】:

我正在尝试使用 js window.opener 技术将选定值从子窗口返回给父 js 函数。这是我设置基本 poc 的 zip 文件的 url:

https://www.dropbox.com/s/gle9sou3gj770ej/WindowOpenerPOC.zip

LaunchPage.html 用于打开 ResolveCaseDialog.html。 ResolveCaseDialog 上的 Submit 按钮将选定的“Resolution Type”值提交给 window.opener.ProcessReturnValue()。

但是,当我单击“提交”按钮时,ResolveCaseDialog js 会引发以下异常:“未捕获的 SecurityError: Blocked a frame with origin "null" from access a frame with origin "null". 协议、域和端口必须匹配。”

您能否看一下这个设置,如果有什么技巧可以让我知道我所缺少的这项工作,请告诉我?

【问题讨论】:

  • 对我来说听起来像是跨站点脚本

标签: javascript


【解决方案1】:

我也有类似的问题,你必须使用

opener.ProcessReturnValue();

而不是

window.opener.ProcessReturnValue()

这适用于 Internet Explorer,但不适用于 Chrome。

现在的问题是没有指定端口。 我们向前迈进了一步,但问题还没有解决。

这里有一个例子: call opener function

主页是testA,调用testB。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-01-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-07-23
    • 2015-05-22
    • 1970-01-01
    相关资源
    最近更新 更多