Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Headless Browser Experiments
Search
Christian Bäuerlein
January 28, 2016
Programming
0
400
Headless Browser Experiments
A short journey about taking screenshots with headless browsers.
Christian Bäuerlein
January 28, 2016
Tweet
Share
More Decks by Christian Bäuerlein
See All by Christian Bäuerlein
Single File Ruby Programs @ RubyUnconf 2023
fabrik42
0
160
Single File Ruby Programs 2.0
fabrik42
1
210
Single File Ruby Programs
fabrik42
0
280
Agile Software Development for Software Developers
fabrik42
0
53
Phoenix Live View
fabrik42
0
610
Rails API-only considerations
fabrik42
0
370
Org-Mode
fabrik42
0
530
Flocking Simulation with Phoenix Channels
fabrik42
1
390
Cleaner, scalable views with object oriented components
fabrik42
0
370
Other Decks in Programming
See All in Programming
GraalVM Native Image トラブルシューティング機能の最新状況(2025年版)
ntt_dsol_java
0
170
Chart.jsで長い項目を表示するときのハマりどころ
yumechi
0
150
flutter_kaigi_2025.pdf
kyoheig3
1
360
なぜ強調表示できず ** が表示されるのか — Perlで始まったMarkdownの歴史と日本語文書における課題
kwahiro
12
7.2k
Phronetic Team with AI - Agile Japan 2025 closing
hiranabe
2
670
目的で駆動する、AI時代のアーキテクチャ設計 / purpose-driven-architecture
minodriven
10
3.4k
「正規表現をつくる」をつくる / make "make regex"
makenowjust
1
780
Stay Hacker 〜九州で生まれ、Perlに出会い、コミュニティで育つ〜
pyama86
2
2.5k
How Software Deployment tools have changed in the past 20 years
geshan
0
6k
Atomics APIを知る / Understanding Atomics API
ssssota
1
200
251126 TestState APIってなんだっけ?Step Functionsテストどう変わる?
east_takumi
0
110
Nitro v3
kazupon
2
320
Featured
See All Featured
Art, The Web, and Tiny UX
lynnandtonic
303
21k
Leading Effective Engineering Teams in the AI Era
addyosmani
8
1.1k
It's Worth the Effort
3n
187
29k
Making the Leap to Tech Lead
cromwellryan
135
9.6k
[RailsConf 2023] Rails as a piece of cake
palkan
57
6.1k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.7k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.6k
Rails Girls Zürich Keynote
gr2m
95
14k
GraphQLとの向き合い方2022年版
quramy
49
14k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
Transcript
HEADLESS BROWSER EXPERIMENTS A short journey about taking screenshots with
headless browsers Christian Bäuerlein / @fabrik42
A headless browser is a web browser without a graphical
user interface.
PhantomJS SlimerJS CasperJS many more!
USE CASES Running test suites Web scraping / Automation Taking
screenshots
TAKING SCREENSHOTS
The project: A desktop website that lets users create a
custom mobile web app.
The challenges: How to render a list of created apps?
How to share your creations with others?
HTML IS NOT SHAREABLE URLs are easy to share. Textual
content is easy to share. Visual representations in HTML are not easy to share. But images are :)
SCREENSHOTS!
None
None
PHANTOMJS 1.X Good Just one binary Not So Good Project
was somehow stalled Bad No web font support :(
PHANTOMJS 2.0! Including web font support! *yay* Let's try again...
PROBLEM Present your work on a web page to somebody
who can't access it right now.
RESPONSIVE MOCKUPS github.com/fabrik42/responsive_mockups
RESPONSIVE MOCKUPS Takes screenshots of a webpage in different resolutions
and automatically applies it to mockup templates.
None
None
None
REQUIREMENTS Easy to install. No dependencies, if possible. Nice templates
to start right away.
EASY INSTALLATION brew install phantomjs git clone [responsive_mockups] && cd
responsive_mockups phantomjs example.js
EXAMPLE.JS var mockup = require('./index'); mockup.create({ url: 'https://flinc.org/home', template: 'flat_responsive_2',
output: 'my_mockup.png' });
HOW IT WORKS 1. User provides URL and template name.
2. PhantomJS generates screenshots based on different viewports. 3. PhantomJS assembles mockup image using a local HTML file and <canvas>.
None
None
None
None
None
None
None
None
RESPONSIVE MOCKUPS github.com/fabrik42/responsive_mockups
Mockup graphics are nice, but what about... MOCKUP PHOTOS?
None
None
DEMO TIME!
http://phantomjs.org/supported-web-standards.html WebGL CSS 3D Video and Audio The following features,
due to the nature of PhantomJS, are irrelevant:
None
Atom Editor Visual Studio Code Slack Mapbox Map Designer ...
nightmare.js!
Knows how to WebGL :)
None
ONE MORE THING...
Now that we mastered all kind of images, what about...
MOVIES!
None
STOP MOTION IN HTML & JS Create an animation Stop
at every frame Make a screenshot Go to the next frame
DEMO TIME!
Remember: We wanted to make things shareable.
CUSTOMIZED MOVIES!
Manipulate the movie while rendering the frames browser .evaluate(function (currentFrame)
{ stage.goto(currentFrame); }, currentFrame)
ADVANCED DEMO TIME!
Q & A Christian Bäuerlein github.com/fabrik42 twitter.com/fabrik42
[email protected]