Skip to content

Commit

Permalink
Fire document start/end events for remote pages
Browse files Browse the repository at this point in the history
For #4788
  • Loading branch information
rogerwang committed May 4, 2016
1 parent 2affcd1 commit 9726928
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/nw_content.cc
Original file line number Diff line number Diff line change
Expand Up @@ -422,17 +422,14 @@ void DocumentHook2(bool start, content::RenderFrame* frame, Dispatcher* dispatch
->GetWebView()->mainFrame()->mainWorldScriptContext();
ScriptContext* script_context =
dispatcher->script_context_set().GetByV8Context(v8_context);
if (!script_context || !script_context->extension())
if (!script_context)
return;
if (script_context->extension()->GetType() == Manifest::TYPE_NWJS_APP &&
script_context->context_type() == Feature::BLESSED_EXTENSION_CONTEXT) {
std::vector<v8::Handle<v8::Value> > arguments;
v8::Local<v8::Value> window =
web_frame->mainWorldScriptContext()->Global();
arguments.push_back(v8::Boolean::New(isolate, start));
arguments.push_back(window);
script_context->module_system()->CallModuleMethod("nw.Window", "onDocumentStartEnd", &arguments);
}
std::vector<v8::Handle<v8::Value> > arguments;
v8::Local<v8::Value> window =
web_frame->mainWorldScriptContext()->Global();
arguments.push_back(v8::Boolean::New(isolate, start));
arguments.push_back(window);
script_context->module_system()->CallModuleMethod("nw.Window", "onDocumentStartEnd", &arguments);
}

void DocumentElementHook(blink::WebLocalFrame* frame,
Expand Down

0 comments on commit 9726928

Please sign in to comment.