Skip to content

Instantly share code, notes, and snippets.

@avallete
Created July 18, 2020 13:10
Show Gist options
  • Select an option

  • Save avallete/895d73275ca77c02922a9a3160e8c477 to your computer and use it in GitHub Desktop.

Select an option

Save avallete/895d73275ca77c02922a9a3160e8c477 to your computer and use it in GitHub Desktop.
A quick test to retrieve the '#hoverme' div nodeId trough CDP
<!DOCTYPE html>
<html>
<head>
<title>Shadow DOM Fixture</title>
</head>
<body>
<div id="host"></div>
<script>
document
.getElementById('host')
.attachShadow({mode: 'open'})
.innerHTML = `
<style>
.shadow-button {
height: 100px;
width: 100px;
background-color: blue;
}
.shadow-button:hover {
background-color: red;
}
</style>
<div id="hoverme" class="shadow-button">SHADOW DOM</div>
`;
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment