Index: content/renderer/devtools/devtools_client.cc |
diff --git a/content/renderer/devtools/devtools_client.cc b/content/renderer/devtools/devtools_client.cc |
index 39bd12a60f4dd1eb855f2a83c9deb799b6e3382d..92dcc177345ab5edfde0a788460bc32eb34e324d 100644 |
--- a/content/renderer/devtools/devtools_client.cc |
+++ b/content/renderer/devtools/devtools_client.cc |
@@ -22,8 +22,11 @@ using blink::WebString; |
namespace content { |
-DevToolsClient::DevToolsClient(RenderFrame* main_render_frame) |
- : RenderFrameObserver(main_render_frame) { |
+DevToolsClient::DevToolsClient( |
+ RenderFrame* main_render_frame, |
+ const std::string& compatibility_script) |
+ : RenderFrameObserver(main_render_frame), |
+ compatibility_script_(compatibility_script) { |
const base::CommandLine& command_line = |
*base::CommandLine::ForCurrentProcess(); |
web_tools_frontend_.reset(WebDevToolsFrontend::create( |
@@ -34,6 +37,11 @@ DevToolsClient::DevToolsClient(RenderFrame* main_render_frame) |
DevToolsClient::~DevToolsClient() { |
} |
+void DevToolsClient::DidClearWindowObject() { |
+ if (!compatibility_script_.empty()) |
+ render_frame()->ExecuteJavaScript(base::UTF8ToUTF16(compatibility_script_)); |
+} |
+ |
void DevToolsClient::sendMessageToBackend(const WebString& message) { |
Send(new DevToolsAgentMsg_DispatchOnInspectorBackend(routing_id(), |
message.utf8())); |