1

How to test within Javascript whether it is running Phantom JS (via Poltergeist) or on a regular browser?

Use case: Suppress logging during testing.

Using Poltergeist, Capybara, Ruby.

B Seven
  • 44,484
  • 66
  • 240
  • 385
  • Did you try checking `navigator.userAgent`? http://user-agent-string.info/list-of-ua/browser-detail?browser=PhantomJS – max Oct 09 '14 at 07:38
  • 2
    possible duplicate of [Reliably detecting PhantomJS-based spam bots](http://stackoverflow.com/questions/20862728/reliably-detecting-phantomjs-based-spam-bots) – Artjom B. Oct 09 '14 at 08:08
  • @ArtjomB. - How do I turn off the logging of phantomjs in ruby ? It spews info into the console. – stack1 Jan 23 '15 at 18:57
  • @ArtjomB. - I made a new question here - http://stackoverflow.com/questions/28117205/ruby-how-do-i-turn-off-the-logging-for-phantomjs – stack1 Jan 23 '15 at 19:27

0 Answers0