Craft Chrome Devtools Protocol (CDP) commands with the new command editor
developer.chrome.com·21h·
Discuss: Hacker News
Flag this post

Chrome DevTools Protocol (CDP) is a remote debugging protocol (API) that lets developers communicate with a running Chrome browser. Chrome DevTools uses CDP to help you inspect the browser’s state, control its behavior, and collect debugging information. You can also build Chrome extensions that use CDP.

For example, this is a CDP command that inserts a new rule with the given ruleText in a stylesheet with given styleSheetId, at the position specified by location.

{
command: 'CSS.addRule',
parameters: {
styleSheetId: '2',
ruleText:'Example',
location: {
startLine: 1,
startColumn: 1,
endLine: 1,
endColumn: 1
}
}
}

The Protocol monitor dra…

Similar Posts

Loading similar posts...