From b10fb4770582b017de4f9b42fc0c716191ddcf0d Mon Sep 17 00:00:00 2001 From: CLannadZSY Date: Thu, 21 Mar 2024 01:47:15 +0000 Subject: [PATCH] =?UTF-8?q?JS=E8=8E=B7=E5=8F=96Shadow=20DOM=E4=B8=ADcloses?= =?UTF-8?q?=20=E8=8A=82=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...70\255 closed \350\212\202\347\202\271.md" | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 "content/blog/2024-03-21/JS\350\216\267\345\217\226 Shadow DOM\344\270\255 closed \350\212\202\347\202\271.md" diff --git "a/content/blog/2024-03-21/JS\350\216\267\345\217\226 Shadow DOM\344\270\255 closed \350\212\202\347\202\271.md" "b/content/blog/2024-03-21/JS\350\216\267\345\217\226 Shadow DOM\344\270\255 closed \350\212\202\347\202\271.md" new file mode 100644 index 0000000..87c99cc --- /dev/null +++ "b/content/blog/2024-03-21/JS\350\216\267\345\217\226 Shadow DOM\344\270\255 closed \350\212\202\347\202\271.md" @@ -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'}); + }; +```