Index: sky/tools/debugger/prompt/prompt.cc |
diff --git a/sky/tools/debugger/prompt/prompt.cc b/sky/tools/debugger/prompt/prompt.cc |
index d411c82618f058ba524ac245a14879794f66cb95..6bcc464b34635acb05918c62df7395d43368cc04 100644 |
--- a/sky/tools/debugger/prompt/prompt.cc |
+++ b/sky/tools/debugger/prompt/prompt.cc |
@@ -73,6 +73,10 @@ class Prompt : public mojo::ApplicationDelegate { |
Reload(); |
return true; |
} |
+ if (command == "inspect") { |
+ Inspect(); |
+ return true; |
+ } |
if (command.size() == 1) { |
char c = command[0]; |
if (c == 'h') |
@@ -111,16 +115,25 @@ class Prompt : public mojo::ApplicationDelegate { |
<< "Sky Debugger" << std::endl |
<< "============" << std::endl |
<< "Type a URL to load in the debugger, enter to reload." << std::endl |
- << "Commands: help -- Help" << std::endl |
- << " trace -- Capture a trace" << std::endl |
- << " reload -- Reload the current page" << std::endl |
- << " q -- Quit" << std::endl; |
+ << "Commands: help -- Help" << std::endl |
+ << " trace -- Capture a trace" << std::endl |
+ << " reload -- Reload the current page" << std::endl |
+ << " inspect -- Inspect the current page" << std::endl |
+ << " q -- Quit" << std::endl; |
} |
void Reload() { |
debugger_->NavigateToURL(url_); |
} |
+ void Inspect() { |
+ debugger_->InjectInspector(); |
+ std::cout |
+ << "Open the following URL in Chrome:" << std::endl |
+ << "chrome-devtools://devtools/bundled/devtools.html?ws=localhost:9898" |
+ << std::endl; |
+ } |
+ |
void Quit() { |
std::cout << "quitting" << std::endl; |
exit(0); |