Add API to execute javascript in devtools.
This commit is contained in:
parent
a50d3bde5c
commit
d7a54cf3a6
4 changed files with 23 additions and 4 deletions
|
@ -225,6 +225,11 @@ void NativeWindow::InspectElement(int x, int y) {
|
|||
agent->InspectElement(x, y);
|
||||
}
|
||||
|
||||
void NativeWindow::ExecuteJavaScriptInDevTools(const std::string& script) {
|
||||
GetDevToolsWebContents()->GetRenderViewHost()->ExecuteJavascriptInWebFrame(
|
||||
string16(), base::UTF8ToUTF16(script));
|
||||
}
|
||||
|
||||
void NativeWindow::FocusOnWebView() {
|
||||
GetWebContents()->GetRenderViewHost()->Focus();
|
||||
}
|
||||
|
@ -612,10 +617,7 @@ void NativeWindow::CallDevToolsFunction(const std::string& function_name,
|
|||
}
|
||||
}
|
||||
}
|
||||
base::string16 javascript =
|
||||
base::ASCIIToUTF16(function_name + "(" + params + ");");
|
||||
GetDevToolsWebContents()->GetRenderViewHost()->ExecuteJavascriptInWebFrame(
|
||||
string16(), javascript);
|
||||
ExecuteJavaScriptInDevTools(function_name + "(" + params + ");");
|
||||
}
|
||||
|
||||
void NativeWindow::OnRendererMessage(const string16& channel,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue