Skip to content

Commit a1d382d

Browse files
committed
Get current RenderView based on Entered context
The extension's function is compiled in the first window's context. It's needed to get the caller's context. Fix nwjs#1187
1 parent b37f7f4 commit a1d382d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/api/bindings_common.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ using WebKit::WebFrame;
3737
using WebKit::WebView;
3838

3939
RenderView* GetCurrentRenderView() {
40-
WebFrame* frame = WebFrame::frameForCurrentContext();
40+
v8::Local<v8::Context> ctx = v8::Context::GetEntered();
41+
WebFrame* frame = WebFrame::frameForContext(ctx);
4142
if (!frame)
4243
return NULL;
4344

0 commit comments

Comments
 (0)