在快手作者个人页面插入元素总会出现目标元素为空,但是我在控制输入查找目标元素的代码可以找得到呀,请问这怎么解决?
个人代码:
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://www.kuaishou.com/profile/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=kuaishou.com
// @grant none
// @run-at document-start
// ==/UserScript==
let getVedioBtn = document.createElement("button")
getVedioBtn.innerText = "复制视频"
getVedioBtn.className = "getVedio"
getVedioBtn.style.background = "#757575";
getVedioBtn.style.color = "#fff";
let ops = document.querySelector(".follow-button.user-info-follow");
ops.addEventListener("DOMNodeInserted", function (event) {
ops.insertAdjacentElement("afterend", getVedioBtn)
})
(问题下图)