diff --git a/Source/WebCore/page/PageConsoleClient.cpp b/Source/WebCore/page/PageConsoleClient.cpp index 0c51d8cac09c1..e9e7f73cf636e 100644 --- a/Source/WebCore/page/PageConsoleClient.cpp +++ b/Source/WebCore/page/PageConsoleClient.cpp @@ -120,7 +120,7 @@ void PageConsoleClient::unmute() void PageConsoleClient::addMessage(std::unique_ptr&& consoleMessage) { - if (!m_page.usesEphemeralSession()) { + if (!m_page.usesEphemeralSession() || m_page.isControlledByAutomation()) { String message; Span additionalArguments; Vector messageArgumentsVector; @@ -198,8 +198,9 @@ void PageConsoleClient::messageWithTypeAndLevel(MessageType type, MessageLevel l InspectorInstrumentation::addMessageToConsole(m_page, WTFMove(message)); - if (m_page.usesEphemeralSession()) + if (m_page.usesEphemeralSession() && !m_page.isControlledByAutomation()) { return; + } if (!messageArgumentsVector.isEmpty()) { m_page.chrome().client().addMessageToConsole(MessageSource::ConsoleAPI, level, messageText, lineNumber, columnNumber, url);