From f5a11ecf9cb9fa928f97a65e65551adc56c3e904 Mon Sep 17 00:00:00 2001 From: chenqianhe <1278095698@qq.com> Date: Thu, 16 May 2024 21:59:48 +0800 Subject: [PATCH] Fix listen element --- manifest.json | 2 +- scripts/content.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index c20710c..820009a 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 3, "name": "ChatGPT Consumption", "description": "Show how many tokens and resources the conversation consumed", - "version": "1.1", + "version": "1.1.1", "action": { "default_popup": "popup/popup.html" }, diff --git a/scripts/content.js b/scripts/content.js index 8bc8276..07d7a86 100644 --- a/scripts/content.js +++ b/scripts/content.js @@ -91,7 +91,7 @@ async function injectCustomElement() { // 创建一个观察器 var mainElement = document.querySelector("main"); if (mainElement) { - new MutationObserver(updateCount).observe(mainElement.children[1].children[0], + new MutationObserver(updateCount).observe(mainElement.children[0].children[0], {childList: true, characterData: true, subtree: true} ); } else {