Allow embedder to bypass devtools prompt

This commit is contained in:
Paul Rouget 2020-06-22 11:06:34 +02:00
parent 3f999ce785
commit 8cf2f14baa
16 changed files with 83 additions and 35 deletions

View file

@ -80,9 +80,10 @@ void BrowserPage::BindServoEvents() {
: Visibility::Visible);
});
servoControl().OnDevtoolsStatusChanged(
[=](DevtoolsStatus status, unsigned int port) {
[=](DevtoolsStatus status, unsigned int port, hstring token) {
mDevtoolsStatus = status;
mDevtoolsPort = port;
mDevtoolsToken = token;
});
Window::Current().VisibilityChanged(
[=](const auto &, const VisibilityChangedEventArgs &args) {
@ -318,8 +319,8 @@ void BrowserPage::OnDevtoolsButtonClicked(IInspectable const &,
hstring port = to_hstring(mDevtoolsPort);
if (mDevtoolsClient == nullptr) {
DevtoolsDelegate *dd = static_cast<DevtoolsDelegate *>(this);
mDevtoolsClient =
std::make_unique<DevtoolsClient>(L"localhost", port, *dd);
mDevtoolsClient = std::make_unique<DevtoolsClient>(L"localhost", port,
mDevtoolsToken, *dd);
}
mDevtoolsClient->Run();
std::wstring message =