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
270
Agile Software Development for Software Developers
fabrik42
0
48
Phoenix Live View
fabrik42
0
590
Rails API-only considerations
fabrik42
0
360
Org-Mode
fabrik42
0
530
Flocking Simulation with Phoenix Channels
fabrik42
1
380
Cleaner, scalable views with object oriented components
fabrik42
0
360
Other Decks in Programming
See All in Programming
WebエンジニアがSwiftをブラウザで動かすプレイグラウンドを作ってみた
ohmori_yusuke
0
160
ネイティブ製ガントチャートUIを作って学ぶUICollectionViewLayoutの威力
jrsaruo
0
110
Чего вы не знали о строках в Python – Василий Рябов, PythoNN
sobolevn
0
150
Platformに“ちょうどいい”責務ってどこ? 関心の熱さにあわせて考える、責務分担のプラクティス
estie
2
510
Local Peer-to-Peer APIはどのように使われていくのか?
hal_spidernight
2
410
CSC305 Lecture 04
javiergs
PRO
0
230
CSC509 Lecture 02
javiergs
PRO
0
400
Pythonスレッドとは結局何なのか? CPython実装から見るNoGIL時代の変化
curekoshimizu
3
930
SpecKitでどこまでできる? コストはどれくらい?
leveragestech
0
360
私はどうやって技術力を上げたのか
yusukebe
41
16k
なぜGoのジェネリクスはこの形なのか? Featherweight Goが明かす設計の核心
ryotaros
7
970
LLMとPlaywright/reg-suitを活用した jQueryリファクタリングの実際
kinocoboy2
4
640
Featured
See All Featured
Rails Girls Zürich Keynote
gr2m
95
14k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
657
61k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.1k
jQuery: Nuts, Bolts and Bling
dougneiner
64
7.9k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
2.6k
Scaling GitHub
holman
463
140k
Designing Experiences People Love
moore
142
24k
Building Applications with DynamoDB
mza
96
6.6k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
127
53k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
32
2.2k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.7k
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]