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
impression of google chrome headless
Search
teitei_tk
May 31, 2017
Programming
0
1.8k
impression of google chrome headless
teitei_tk
May 31, 2017
Tweet
Share
More Decks by teitei_tk
See All by teitei_tk
Claude Code × WebLLM:AI駆動開発で作る次世代PDF要約ツール
teitei
0
21
dive to Ruby on Rails module autoloading
teitei
1
4.4k
貴方はOmniAuth::AuthHashを知っていますか?
teitei
0
7.9k
myhome-progress
teitei
0
77
recommend parallel career
teitei
0
1.1k
嫁に怒られずにGoを書く技術
teitei
0
2.5k
AWS parking lot shutter hack project
teitei
2
3.8k
Other Decks in Programming
See All in Programming
AWS CDKの推しポイント 〜CloudFormationと比較してみた〜
akihisaikeda
3
280
赤裸々に公開。 TSKaigiのオフシーズン
takezoux2
0
140
実践ArchUnit ~実例による検証パターンの紹介~
ogiwarat
2
270
Is Xcode slowly dying out in 2025?
uetyo
0
110
Go1.25からのGOMAXPROCS
kuro_kurorrr
1
770
Datadog RUM 本番導入までの道
shinter61
1
300
Julia という言語について (FP in Julia « SIDE: F ») for 関数型まつり2025
antimon2
3
960
既存デザインを変更せずにタップ領域を広げる方法
tahia910
1
240
ReadMoreTextView
fornewid
1
450
XSLTで作るBrainfuck処理系
makki_d
0
210
KotlinConf 2025 現地参加の土産話
n_takehata
0
100
ドメインモデリングにおける抽象の役割、tagless-finalによるDSL構築、そして型安全な最適化
knih
11
1.9k
Featured
See All Featured
BBQ
matthewcrist
89
9.7k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
Six Lessons from altMBA
skipperchong
28
3.8k
GraphQLの誤解/rethinking-graphql
sonatard
71
11k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
32
5.9k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.9k
Designing for humans not robots
tammielis
253
25k
Agile that works and the tools we love
rasmusluckow
329
21k
Testing 201, or: Great Expectations
jmmastey
42
7.5k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
181
53k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
161
15k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
Transcript
ChromeHeadless modeΛ৮ͬͨॴײ 2017/05/31 @teitei_tk
ࣗݾհ • @teitei_tk • ࠷ۙϋΠϥϧԦࠃΛฏʹ͢ΔͨΊʹؤுͬ ͯ·͢ɻ
ຊ
ͷલʹ
Chrome Headless ͱʁ
͍ΘΏΔHeadlessϒϥβ • ޡղΛঝͰݴ͑ɺGUIͷແ͍Chromeɻ • GUIͳ͍͕ɺ෦తʹϖʔδͷϨϯμϦϯά ͔ΒJavaScriptͷ࣮ߦɺϒϥβͬΆ͍͜ͱ͕ Ͱ͖Δ
Ͳ͏͍͏༻్͕͋Δͷ • WebApplicationͷςετ • ͍ΘΏΔE2E • WebPageͷΩϟϓνϟࡱӨ • WebαΠτͷεΫϨΠϐϯά •
DDoS߈ܸ
ͳͥ Chrome Headless͔
PhantomJSͷࢮ
PhantomJSͱ • HeadlessϒϥβͷҰͭ • ͓ͦΒ͘Ұ൪ਓؾ͕͋ΔͷͰͳ͍ͩΖ͏͔ • ͔͠͠ɺ2017/05/30ݱࡏͰissue1848ɺPull Request58ͱ։ൃఀ͍ͯ͠Δ • https://github.com/ariya/phantomjs/
PhantomJS is Dead • ͦͯ͠།Ұͷϝϯςφ͕ࠓޙΈͳChrome Headlessʹ Γ͑ΔͩΖ͏ͱϝϯςφΛࣙΛએݴɻ • https://groups.google.com/d/msg/phantomjs/9aI5d- LDuNE/5Z3SMZrqAQAJ
• ࠓޙͷߏ͋Δͷ͔ɺphantomiumͱ͍͏PhantomJS + ChromeHeadlessͷ୯ޠ͕Έ߹Θͬͨ͞ϨϙδτϦ͋ Δ • https://github.com/Vitallium/phantomium
ͱ͍͏ͷ͕എܠ
Կނ Chrome Headless͔
• Google͕։ൃ͍ͯ͠Δͱ͍͏҆৺ײ • Webඪ४ͷ४ڌ͕ૣ͍ͷͰɺ͍ͪૣ͘ػೳ͕͑Δɻ • ֤छAPIͷར༻͕Մೳ • ServiceWorker • IndexedDB
• Memory Heap Profiler • etc
ͱ͍͏Θ͚Ͱ ৮ͬͯΈͨ
Setup • Chrome Ver59Ҏ͕߱ඞਢ • ݱࡏ(2017/05/30)ͷChromeͷStable Version58 • Chrome CanaryΛ͏ͱྑͦ͞͏
؆୯ͳͷͳΒ͙͢ग़དྷΔ • ShellͰ͙͢ग़དྷΔ • DOMͷग़ྗ • PDF࡞ • Ωϟϓνϟͷऔಘ •
eg. $ chrome --headless --disable-gpu --dump- dom https://www.chromestatus.com/
దʹWrapperॻ͍ͨ • ΩϟϓνϟͷࡱӨ • https://wobfnz0lh2.execute-api.us- west-2.amazonaws.com/dev/chrome?url=https:// google.co.jp • PDFͷੜ •
https://wobfnz0lh2.execute-api.us- west-2.amazonaws.com/dev/pdf?url=https:// google.com/
• ݴޠɿNode.js • ओʹ༻ͨ͠ϥΠϒϥϦ • chrome-remote-interface • ChromeͷAPIΛୟ͘Node.jsϥΠϒϥϦ • lighthouse
• ChromeΛىಈ͢Δϔϧύʔ͕هࡌ͞Ε͍ͯΔ ϥΠϒϥϦ
ॴײ • ҆ఆԽ·Ͱ͏গֻ͔͠Γͦ͏ɻ • Ṗͷ--disable-gpu Option • API͕·ͩམͪண͍͍ͯͳ͍ͷͰຊ൪ೖ·ͩආ͚ͨ΄͏ ͕ྑͦ͞͏ •
ͱ͍͑PhantomJSͷޙ佂ʹ࠲Γͦ͏ɻ • ಈ͓͖ͬͯ·͢ɻ • Կ͔͋ͬͨΒهࣄͰॻ͍ͯڞ༗͠·͢ɻ