Skip to content

Commit

Permalink
ARRISAPOL-3441 enable console messages in ephemeral sessions (automat…
Browse files Browse the repository at this point in the history
…ion mode)

- WPE 2.22 has option consoleLogWithPrivateBrowsingEnabled,
  now m_page.isControlledByAutomation() will be checked to allow messages
  • Loading branch information
Volodymyr Ogorodnik committed Jul 3, 2024
1 parent 814d7a0 commit cc6731a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Source/WebCore/page/PageConsoleClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ void PageConsoleClient::unmute()

void PageConsoleClient::addMessage(std::unique_ptr<Inspector::ConsoleMessage>&& consoleMessage)
{
if (!m_page.usesEphemeralSession()) {
if (!m_page.usesEphemeralSession() || m_page.isControlledByAutomation()) {
String message;
Span<const String> additionalArguments;
Vector<String> messageArgumentsVector;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit cc6731a

Please sign in to comment.