mirror of
https://github.com/servo/servo.git
synced 2025-08-02 12:10:29 +01:00
UWP: clear console when navigating pages.
This commit is contained in:
parent
bd8c7d6f4d
commit
c7f5d8a266
4 changed files with 10 additions and 1 deletions
|
@ -273,6 +273,11 @@ void BrowserPage::OnPrefererenceSearchboxEdited(
|
|||
}
|
||||
}
|
||||
|
||||
void BrowserPage::ClearConsole() {
|
||||
Dispatcher().RunAsync(CoreDispatcherPriority::Low,
|
||||
[=] { DevtoolsConsoleOutput().Blocks().Clear(); });
|
||||
}
|
||||
|
||||
void BrowserPage::OnDevtoolsMessage(DevtoolsMessageLevel level, hstring source,
|
||||
hstring body) {
|
||||
Dispatcher().RunAsync(CoreDispatcherPriority::Low, [=] {
|
||||
|
|
|
@ -44,6 +44,7 @@ public:
|
|||
void OnPrefererenceSearchboxEdited(IInspectable const &,
|
||||
Input::KeyRoutedEventArgs const &);
|
||||
void OnDevtoolsMessage(servo::DevtoolsMessageLevel, hstring, hstring);
|
||||
void ClearConsole();
|
||||
void OnDevtoolsDetached();
|
||||
|
||||
private:
|
||||
|
|
|
@ -133,7 +133,9 @@ void DevtoolsClient::HandleMessage(JsonObject obj) {
|
|||
// Ignore
|
||||
return;
|
||||
} else if (obj.GetNamedString(L"type") == L"tabNavigated") {
|
||||
// Ignore
|
||||
if (obj.HasKey(L"state") && obj.GetNamedString(L"state") == L"stop") {
|
||||
mDelegate.ClearConsole();
|
||||
}
|
||||
return;
|
||||
} else if (obj.GetNamedString(L"type") == L"networkEventUpdate") {
|
||||
// FIXME: log if there is a non-200 HTTP response
|
||||
|
|
|
@ -51,6 +51,7 @@ private:
|
|||
class DevtoolsDelegate {
|
||||
public:
|
||||
virtual void OnDevtoolsMessage(DevtoolsMessageLevel, hstring, hstring) = 0;
|
||||
virtual void ClearConsole() = 0;
|
||||
virtual void OnDevtoolsDetached() = 0;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue