是否可以创建修改HTTP响应正文的Chrome扩展程序?
我查看了Chrome扩展API,但我没有找到任何可以执行此操作的内容.
我想"抓住" <body>创造的第一个时刻.我试过用DOMNodeInserted/ DOMNodeInsertedIntoDocument.这是我的代码:
<html>
<head>
<script>
document.addEventListener("DOMNodeInserted", handleDomInserted, true);
document.addEventListener("DOMNodeInsertedIntoDocument", handleDOMNodeInsertedIntoDocument, true);
function handleDOMNodeInsertedIntoDocument(e) {
console.log(e);
}
function handleDomInserted(e) {
console.log(e);
}
</script>
</head>
<body>
<div id="foo">
<span id="bazz"></span>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
为什么这些函数永远不会被调用?
谢谢!