PhantomJS

Original author(s)| Ariya Hidayat
Developer(s)| Ariya Hidayat
Initial release| January 17, 2011; 15 years ago (2011-01-17)
Final release|

2.1.1[1] / January 24, 2016; 10 years ago (2016-01-24)

Written in| C++, JavaScript, C
Type| Headless browser
License| BSD[2]

PhantomJS is a discontinued headless browser used for automating web page interaction. PhantomJS provides a JavaScript API enabling automated navigation, screenshots, user behavior and assertions making it a common tool used to run browser-based unit tests in a headless system like a continuous integration environment. PhantomJS is based on WebKit making it a similar browsing environment to Safari and Google Chrome (before Chrome's fork of WebKit evolved into Blink). It is open-source software released under the BSD License.[2]

## Contents

* 1 History
* 2 Usage
* 3 Ecosystem
* 4 Users
* 5 See also
* 6 References
* 7 External links

## History

PhantomJS was released January 23, 2011 by Ariya Hidayat after several years in development.[3]

The first commit to the public project was in 2011.[4]

The logo commonly used to pictorially refer to PhantomJS is a fluorescent blue ghost atop a black background. This refers to the lack of graphical user interface, or main body of the browser, making PhantomJS users seem like ghosts.

In March 2018, the development of PhantomJS was suspended due to lack of active contributions.[5]

## Usage

The PhantomJS JavaScript API can be used to open web pages, take screenshots, execute user actions, and run injected JavaScript in the page context. For example, the following code will open Wikipedia and, upon loading, will save a screenshot to a file and exit.

console.log('Loading a web page');
var page = require('webpage').create();
var url = 'http://en.wikipedia.org/';
page.open(url, function (status) {
console.log('Page loaded');
page.render('wikipedia.org.png');
phantom.exit();
});

## Ecosystem

PhantomJS became valuable enough that similar projects adopted the API as a standard way of interacting with headless browsers. SlimerJS provided a PhantomJS-like API, but on top of Mozilla's Gecko browser engine rather than WebKit.[6] Similarly, trifleJS targeted the MSHTML engine of Internet Explorer.[7]

Shortly after the release of PhantomJS, Nicolas Perriault wrote CasperJS, a suite of libraries on top of PhantomJS that extend its capabilities as a client for automated web page testing, allowing users to create BDD tests leveraging PhantomJS. The final release of CasperJS was in 2017.[8]

Yahoo! developed a version of YSlow that leverages PhantomJS to gather performance metrics for websites.[9]

## Users

Several notable companies have used PhantomJS.

* Twitter used QUnit and PhantomJS for unit testing as of 2015.[10]
* LinkedIn used PhantomJS based tools for performance testing as of 2011.[11]
* Netflix used Sketchy, a headless browser built with PhantomJS, to understand what it's doing without having to visit the site as of 2014.[clarification needed][12]
* Time Warner Cable used PhantomJS with CoffeeScript, Jasmine, and JUnit XML for Jenkins continuous integration as of 2012.[13]

## See also

* Headless browser

## References

1. ↑ "Releases · ariya/phantomjs". https://github.com/ariya/phantomjs/releases. Retrieved 21 April 2017.
2. ↑ 2.0 2.1 "phantomjs/LICENSE.BSD at master · ariya/phantomjs" (in en). https://github.com/ariya/phantomjs/blob/master/LICENSE.BSD.
3. ↑ "don't code today what you can't debug tomorrow". ariya.blogspot.com. 23 January 2011. http://ariya.blogspot.com/2011/01/phantomjs-minimalistic-headless-webkit.html. Retrieved 20 July 2015.
4. ↑ "ariya/phantomjs". GitHub. https://github.com/ariya/phantomjs. Retrieved 20 July 2015.
5. ↑ "Archiving the project: suspending the development". ariya/phantomjs. Github. 2018-03-03. https://github.com/ariya/phantomjs/issues/15344.
6. ↑ Laurent Jouanneau. "FaQ - SlimerJS". slimerjs.org. http://slimerjs.org/faq.html. Retrieved 20 July 2015.
7. ↑ "A headless Internet Explorer browser using the .NET WebBrowser Class with a Javascript API running on the V8 engine". http://triflejs.org/. Retrieved 20 July 2015.
8. ↑ "CasperJS on GitHub". https://github.com/casperjs/casperjs.
9. ↑ Marcel Duran. "YSlow - Official Open Source Project Website". yslow.org. http://yslow.org/phantomjs/. Retrieved 20 July 2015.
10. ↑ "Leo Lanese on Twitter". Twitter. https://twitter.com/leolaneseltd/status/197766152745787392. Retrieved 20 July 2015.
11. ↑ phegaro (11 October 2011). "LinkedIn Mobile: How do we do it?". SlideShare. http://www.slideshare.net/phegaro/linkedin-mobile-how-do-we-do-it. Retrieved 20 July 2015.
12. ↑ Michael Mimoso (26 August 2014). "Netflix Open Source Security Tools Solve Range of Challenges". threatpost.com. http://threatpost.com/netflix-open-source-security-tools-solve-range-of-challenges/107931#sthash.pcyW3Ksf.dpuf. Retrieved 20 July 2015.
13. ↑ "one year of wandering headlessly". ofilabs.com. http://ariya.ofilabs.com/2012/01/one-year-of-wandering-headlessly.html. Retrieved 20 July 2015.

## External links

* Official website
* GitHub

* v
* t
* e

Web browsers

Features * standards * protocols

| Features|

* Bookmarks
* Extensions
* Privacy mode
* Sync

|

Web standards|

* HTML
* v5
* CSS
* DOM
* JavaScript
* IndexedDB
* Web storage
* WebAssembly
* WebGL

Protocols|

* HTTP
* v2
* v3
* Cookies
* Encryption
* OCSP
* WebRTC
* WebSocket

Active

| Blink-based|

* Avast Secure Browser
* Beaker
* Blisk
* Brave
* Chrome
* Chromium
* Coc Coc
* Dragon
* Epic
* Falkon
* Kinza
* Maxthon
* Opera
* Otter
* Puffin
* SalamWeb
* Samsung Internet
* Silk
* Sleipnir
* Sputnik
* SRWare
* Torch
* UC
* Vivaldi
* Whale
* Yandex

|

Gecko-based|

* Firefox
* GNU IceCat
* IceDragon
* K-Meleon
* PirateBrowser
* SeaMonkey
* TenFourFox
* Tor
* Waterfox

WebKit-based|

* Dolphin
* Dooble
* GNOME Web
* iCab
* Konqueror
* Midori
* Safari
* surf

Other|

* 360
* Avant
* Basilisk
* CM Browser
* Edge
* eww
* Internet Explorer
* Links
* Lunascape
* Lynx
* NetFront
* NetSurf
* Pale Moon
* QQ browser
* qutebrowser
* SlimBrowser
* w3m

Discontinued

| Gecko-based|

* Beonex Communicator
* Camino
* Classilla
* Conkeror
* Galeon
* Ghostzilla
* Kazehakase
* Kylo
* Lotus
* MicroB
* Minimo
* Mozilla suite
* Pogo
* Strata
* Swiftfox
* Swiftweasel
* Timberwolf
* xB

|

Trident-based|

* AOL
* Deepnet
* GreenBrowser
* MediaBrowser
* MenuBox
* NeoPlanet
* NetCaptor
* SpaceTime
* UltraBrowser
* WebbIE
* ZAC

WebKit-based|

* Arora
* BOLT
* Opera Coast
* Flock
* Fluid
* Google TV
* Iris
* Mercury
* OmniWeb
* Origyn
* QtWeb
* rekonq
* Rockmelt
* Shiira
* Steel
* Browser for Symbian
* Uzbl
* WebPositive
* xombrero

Other|

* abaco
* Amaya
* Arachne
* Arena
* Blazer
* Charon
* Deepfish
* Dillo
* ELinks
* Gazelle
* HotJava
* IBM Home Page Reader
* IBM WebExplorer
* IBrowse
* KidZui
* Line Mode
* Mosaic
* MSN TV
* NetPositive
* Netscape
* Skweezer
* Skyfire
* Teashark
* ThunderHawk
* Vision
* WinWAP
* WorldWideWeb

* Category
* Comparisons
* List

* v
* t
* e

JavaScript

Code analysis|

* ESLint
* JSHint
* JSLint

Transcompilers|

* Babel.js
* CoffeeScript
* LiveScript
* Dart
* Emscripten
* Google Closure Compiler
* Google Web Toolkit
* Morfik
* TypeScript
* AtScript
* Opa
* Nim
* Haxe
* ClojureScript
* WebSharper
* PureScript
* Reason
* Elm

Concepts|

* Client-side
* JavaScript library
* JavaScript syntax
* Unobtrusive JavaScript

Debuggers|

* Firebug
* Komodo IDE
* Microsoft Script Debugger
* Microsoft Script Editor
* Opera Dragonfly
* Web Inspector

Doc generators|

* JSDoc

Editors (comparison)|

* Ace
* Cloud9 IDE
* Atom
* CodeMirror
* Light Table
* Brackets
* Koding
* PhpStorm
* Orion
* Visual Studio
* Visual Studio Express
* Visual Studio Code
* Visual Studio Team Services

Engines|

* Comparison of engines
* DOM support
* List of ECMAScript engines

Frameworks|

* Comparison of JavaScript frameworks
* List of JavaScript libraries

Related technologies|

* Cascading Style Sheets
* Document Object Model
* HTML
* Dynamic HTML
* Ajax
* JSON
* WebAssembly
* asm.js

Package managers|

* npm

Application Bundlers|

* Webpack

Server-side|

* Active Server Pages
* CommonJS
* JSGI
* Node.js
* Wakanda

Unit testing|

* Jasmine
* Mocha
* QUnit
* List of JavaScript unit testing frameworks
* Jest

People|

* Douglas Crockford
* Brendan Eich
* John Resig

0.00

(0 votes)

Original source: https://en.wikipedia.org/wiki/PhantomJS. Read more

|

Retrieved from "https://handwiki.org/wiki/index.php?title=Software:PhantomJS&oldid=3990897"
*[v]: View this template
*[t]: Discuss this template
*[e]: Edit this template