Index: content/browser/debugger/devtools_http_handler_impl.cc |
diff --git a/content/browser/debugger/devtools_http_handler_impl.cc b/content/browser/debugger/devtools_http_handler_impl.cc |
index 819cd523c223a5f05bd06b42f3b1cdb7871e34d7..aacf2ea3f05df2c0440017ee50fe746029450b22 100644 |
--- a/content/browser/debugger/devtools_http_handler_impl.cc |
+++ b/content/browser/debugger/devtools_http_handler_impl.cc |
@@ -428,7 +428,16 @@ void DevToolsHttpHandlerImpl::OnJsonRequestUI( |
base::JSONWriter::WriteWithOptions(&json_pages_list, |
base::JSONWriter::OPTIONS_PRETTY_PRINT, |
&response); |
- Send200(connection_id, response, "application/json; charset=UTF-8"); |
+ |
+ size_t jsonp_pos = info.path.find("?jsonp="); |
+ if (jsonp_pos == std::string::npos) { |
+ Send200(connection_id, response, "application/json; charset=UTF-8"); |
+ return; |
+ } |
+ |
+ std::string jsonp = info.path.substr(jsonp_pos + 7); |
+ response = StringPrintf("%s(%s);", jsonp.c_str(), response.c_str()); |
+ Send200(connection_id, response, "text/javascript; charset=UTF-8"); |
} |
void DevToolsHttpHandlerImpl::OnWebSocketRequestUI( |