Dunfey · Hotel WWDC as data, est. 1983
Front desk everything
Years
Topics

2022 Safari & Web

WWDC22 · 18 min · Safari & Web

Create Safari Web Inspector Extensions

Learn how to add your own tools directly into Web Inspector using the latest Web Extensions APIs. We’ll show you how to create your own tab in Web Inspector, evaluate JavaScript in the inspected page, and use the result to help you troubleshoot and identify potential problems.

Watch at developer.apple.com ↗

Transcript all transcripts

Code shown on screen · 2 snippets

Evaluating scripts inside the inspected page swift · at 12:11 ↗
// Evaluating scripts inside the inspected page

let result = await browser.devtools.inspectedWindow.eval("foo.bar()");
Evaluating scripts inside a frame in the inspected page javascript · at 12:40 ↗
// Evaluating scripts inside a frame in the inspected page

let result = await browser.devtools.inspectedWindow.eval("foo.bar()", {
    frameURL: "http://example.com/",
});

Resources