|
@@ -55,6 +55,8 @@ const observer = new MutationObserver((mutations) => {
|
|
|
if (mutation.type === "childList") {
|
|
|
mutation.addedNodes.forEach((node) => {
|
|
|
if (node.nodeName === "SCRIPT" && node.src) {
|
|
|
+ const url = new URL(node.src);
|
|
|
+ if (url.pathname.startsWith("/lib")) return;
|
|
|
jsRequests.add(node.src);
|
|
|
}
|
|
|
});
|
|
@@ -69,6 +71,8 @@ observer.observe(document, { childList: true, subtree: true });
|
|
|
const scripts = Array.from(document.getElementsByTagName("script"));
|
|
|
scripts.forEach((script) => {
|
|
|
if (script.src) {
|
|
|
+ const url = new URL(script.src);
|
|
|
+ if (url.pathname.startsWith("/lib")) return;
|
|
|
jsRequests.add(script.src);
|
|
|
}
|
|
|
});
|
|
@@ -76,8 +80,9 @@ scripts.forEach((script) => {
|
|
|
let isOpen = false;
|
|
|
|
|
|
function clickHandler(e) {
|
|
|
- chrome.runtime.sendMessage({ action: "show_popup", data: "打开新页面" });
|
|
|
console.log(jsRequests);
|
|
|
+ console.log(oldTarget);
|
|
|
+ chrome.runtime.sendMessage({ action: "show_popup", data: "打开新页面" });
|
|
|
}
|
|
|
|
|
|
// window.addEventListener("click", function (e) {
|