Шукати в статтях підтримки

Остерігайтеся нападів зловмисників. Mozilla ніколи не просить вас зателефонувати, надіслати номер телефону у повідомленні або поділитися з кимось особистими даними. Будь ласка, повідомте про підозрілі дії за допомогою меню “Повідомити про зловживання”

Learn More

Ця тема перенесена в архів. Якщо вам потрібна допомога, запитайте.

Is the Firefox Web Console accessible in headless mode?

  • 1 відповідь
  • 1 має цю проблему
  • 285 переглядів
  • Остання відповідь від grobber

more options

The title says it all: I am wondering whether it is possible to interact with the Firefox console upon starting Firefox in headless mode.

More generally, I'd settle for some way of accessing it programmatically, in scripts.

What I've tried:

So far I've been playing with the Javascript bindings to Selenium without success:

Starting Firefox with the -devtools option from Selenium does opn the dev tools, but I then cannot send key combinations that will switch me to the actual console, or in fact interact from my `.js` script with the open devtools window in any way.

The title says it all: I am wondering whether it is possible to interact with the Firefox [https://developer.mozilla.org/en-US/docs/Tools/Web_Console console] upon starting Firefox in [https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode headless mode]. More generally, I'd settle for some way of accessing it programmatically, in scripts. '''What I've tried:''' So far I've been playing with the [https://www.npmjs.com/package/selenium-webdriver Javascript bindings] to [https://github.com/SeleniumHQ Selenium] without success: Starting Firefox with the [https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options -devtools option] from Selenium does opn the dev tools, but I then [https://github.com/SeleniumHQ/selenium/issues/8665 cannot] send key combinations that will switch me to the actual console, or in fact interact from my `.js` script with the open devtools window in any way.

Змінено grobber

Обране рішення

Усі відповіді (1)

more options

Вибране рішення

It is, as discussed on Stack Overflow:

https://stackoverflow.com/a/63708393/11064961