Skip to content

Commit

Permalink
release: v1.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
surunzi committed Sep 27, 2024
1 parent 7a1d134 commit bf61c32
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.8.1 (27 Sep 2024)

* fix: shadowRoot hook

## 1.8.0 (26 Sep 2024)

* feat: support shadow dom
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chobitsu",
"version": "1.8.0",
"version": "1.8.1",
"description": "Chrome devtools protocol JavaScript implementation",
"main": "dist/chobitsu.js",
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion src/domains/DOM.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function hookAttachShadow() {
return shadowRoot
}

;(this as any).__shadowRoot__ = shadowRoot
;(this as any).chobitsuShadowRoot = shadowRoot
if (isEnable) {
mutationObserver.observe(shadowRoot)
const hostId = getNodeId(this)
Expand Down
4 changes: 2 additions & 2 deletions src/lib/nodeManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ export function wrap(node: any, { depth = 1 } = {}) {

if (node.shadowRoot) {
ret.shadowRoots = [wrap(node.shadowRoot, { depth: 1 })]
} else if (node.__shadowRoot__) {
ret.shadowRoots = [wrap(node.__shadowRoot__, { depth: 1 })]
} else if (node.chobitsuShadowRoot) {
ret.shadowRoots = [wrap(node.chobitsuShadowRoot, { depth: 1 })]
}
if (isShadowRoot(node)) {
ret.shadowRootType = node.mode || 'user-agent'
Expand Down

0 comments on commit bf61c32

Please sign in to comment.