Skip to content

Commit e62c9f3

Browse files
committed
enter parent frame context when called from iframe
Fix nwjs#2713
1 parent 154b760 commit e62c9f3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/api/dispatcher.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,10 @@ void Dispatcher::willHandleNavigationPolicy(
217217
v8::HandleScope handleScope(isolate);
218218

219219
v8::Handle<v8::Value> id_val;
220-
if (web_view->mainFrame() && !web_view->mainFrame()->mainWorldScriptContext().IsEmpty())
220+
if (web_view->mainFrame() && !web_view->mainFrame()->mainWorldScriptContext().IsEmpty()) {
221+
v8::Context::Scope cscope (web_view->mainFrame()->mainWorldScriptContext());
221222
id_val = nwapi::Dispatcher::GetWindowId(web_view->mainFrame());
223+
}
222224
if (id_val.IsEmpty())
223225
return;
224226
if (id_val->IsUndefined() || id_val->IsNull())

0 commit comments

Comments
 (0)