DevTools and Headless Chrome - The Automation Power-Couple

A presentation at Render Conf in March 2018 in Oxford, UK by Yonatan Mevorach

Slide 1

Slide 1

DEVTOOLS & HEADLESS CHROME: THE AUTOMATION POWER-COUPLE

Slide 2

Slide 2

Yonatan Mevorach @cowchimp

Slide 3

Slide 3

Web Automation youtu.be/fsF7enQY8uI

Slide 4

Slide 4

”I can’t automate this” -- no one ever (after watching this talk)

Slide 5

Slide 5

Headless Browsers cbnd flic.kr/p/qnSPdN

Slide 6

Slide 6

Chrome

Slide 7

Slide 7

headless Chrome

Slide 8

Slide 8

Slide 9

Slide 9

Slide 10

Slide 10

[ { { { { { { { { { { { { { { { { { { { { { ] time: time: time: time: time: time: time: time: time: time: time: time: time: time: time: time: time: time: time: time: time: "08:00", "09:00", "09:10", "09:40", "10:10", "10:40", "11:10", "11:30", "11:50", "12:20", "12:40", "13:40", "13:55", "14:10", "14:25", "14:55", "15:25", "15:55", "16:35", "17:15", "17:25", title: title: title: title: title: title: title: title: title: title: title: title: title: title: title: title: title: title: title: title: title: "Registration and breakfast" }, "Welcome" }, "A CSS Carol" }, "Talk details coming soon" }, "Common ways we break accessibility and how to avoid them" }, "Refreshments" }, "DevTools and Headless Chrome - The Automation Power-Couple" }, "Reducing the friction of online payments" }, "How to hack a web app?" }, "Teach Your Bundler The Users' Habits" }, "Lunch" }, "Creating IoT applications with Web Bluetooth" }, "Escaping the Sandbox with Puck.js" }, "Physical interfaces for digital applications" }, "Let's Get Chatty with Conversational Interface in JavaScript" }, "WebAssembly as cross-platform architecture?!" }, "Refreshments" }, "Data Sketches | A year of exotic data visualizations" }, "Serving for the win - Deploys and hosting for the rest of us" }, "Closing remarks" }, "After Party" }

Slide 11

Slide 11

Slide 12

Slide 12

Slide 13

Slide 13

Slide 14

Slide 14

Slide 15

Slide 15

Slide 16

Slide 16

Slide 17

Slide 17

Slide 18

Slide 18

Slide 19

Slide 19

Slide 20

Slide 20

Chrome DevTools

Slide 21

Slide 21

Slide 22

Slide 22

Slide 23

Slide 23

protocol Chrome DevTools

Slide 24

Slide 24

DevTools Embedding Frontendapp WebSockets ChromeAPI Headless Adapted from content by © Sami Kyöstilä, Google goo.gl/yQi9kZ

Slide 25

Slide 25

{ id: 1, method: "Runtime.evaluate", params: { expression: "1 + 1" } } DevTools Embedding Frontendapp ChromeAPI Headless Adapted from content by © Sami Kyöstilä, Google goo.gl/yQi9kZ

Slide 26

Slide 26

{ id: 1, method: "Runtime.evaluate", params: { expression: "1 + 1" } } DevTools Embedding Frontendapp ChromeAPI Headless { id: 1, result: { result: { type: "number", value: 2, description: "2" }, wasThrown: false } } Adapted from content by © Sami Kyöstilä, Google goo.gl/yQi9kZ

Slide 27

Slide 27

DevTools Embedding client app DevTools Headlesstarget API Adapted from content by © Sami Kyöstilä, Google goo.gl/yQi9kZ

Slide 28

Slide 28

node --inspect index.js

Slide 29

Slide 29

Slide 30

Slide 30

Slide 31

Slide 31

Slide 32

Slide 32

headless protocol

Slide 33

Slide 33

chrome --headless --remote-debugging-port=9222 https://2018.render-conf.com

Slide 34

Slide 34

chrome --headless --remote-debugging-port=9222 https://2018.render-conf.com

Slide 35

Slide 35

chrome --headless --remote-debugging-port=9222 https://2018.render-conf.com

Slide 36

Slide 36

chrome --headless --remote-debugging-port=9222 https://2018.render-conf.com

Slide 37

Slide 37

chrome --headless --remote-debugging-port=9222 https://2018.render-conf.com

Slide 38

Slide 38

Slide 39

Slide 39

Slide 40

Slide 40

Slide 41

Slide 41

Slide 42

Slide 42

Slide 43

Slide 43

Slide 44

Slide 44

Slide 45

Slide 45

Slide 46

Slide 46

Slide 47

Slide 47

Slide 48

Slide 48

tinyurl.com/ headless-talk @cowchimp blog.cowchimp.com