Skip to content

Commit

Permalink
JS获取Shadow DOM中closes 节点
Browse files Browse the repository at this point in the history
  • Loading branch information
CLannadZSY committed Mar 21, 2024
1 parent db1da91 commit b10fb47
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions content/blog/2024-03-21/JS获取 Shadow DOM中 closed 节点.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: "JS获取Shadow DOM中closes 节点"
description: ""
lead: ""
date: 2024-03-21T01:44:00Z
lastmod: 2024-03-21T01:44:00Z
draft: false
weight: 50
contributors: [clannadzsy]
url: "/blog/3082362680/"
---

安装 [`油猴`](https://www.tampermonkey.net/) 插件, 在你需要获取的网站, 新建脚本, 填入以下代码, 刷新页面即可

```js
Element.prototype._attachShadow = Element.prototype.attachShadow;
Element.prototype.attachShadow = function () {
return this._attachShadow({mode:'open'});
};
```

0 comments on commit b10fb47

Please sign in to comment.