From 5bdaf105a176bc0ed9ab6a82e75b74f8a602d03d Mon Sep 17 00:00:00 2001 From: xu_yanfeng Date: Sat, 8 Feb 2025 11:41:59 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=84=E4=BB=B7=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ga/type.ts | 1 + src/scripts/background/index.ts | 1 + src/scripts/background/notify.ts | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/src/ga/type.ts b/src/ga/type.ts index 23ce07b..37ff9ab 100644 --- a/src/ga/type.ts +++ b/src/ga/type.ts @@ -80,6 +80,7 @@ export enum GA_EventName { EngineVersion = "engine_version", AppVersion = "app_version", Popup = "popup", + Rate = "rate", GameUrl = "game_url", GamePlayer = "game_player", GamePause = "game_pause", diff --git a/src/scripts/background/index.ts b/src/scripts/background/index.ts index 029dd14..bca67d9 100644 --- a/src/scripts/background/index.ts +++ b/src/scripts/background/index.ts @@ -2,6 +2,7 @@ import { debugLog, Page, PluginEvent } from "../../core/types"; import { getDevToolsInspectorId } from "../../core/util"; import { Terminal } from "../terminal"; import { tabMgr } from "./tabMgr"; +import "./notify"; const terminal = new Terminal(Page.Background); debugLog && console.log(...terminal.init()); diff --git a/src/scripts/background/notify.ts b/src/scripts/background/notify.ts index f70491f..1d5bc3b 100644 --- a/src/scripts/background/notify.ts +++ b/src/scripts/background/notify.ts @@ -1,4 +1,6 @@ import PKG from "../../../cc-plugin.config"; +import { ga } from "../../ga"; +import { GA_EventName } from "../../ga/type"; (async () => { interface ConfigItem { id: string; @@ -24,6 +26,7 @@ import PKG from "../../../cc-plugin.config"; // type: "normal", // }); chrome.tabs.create({ url: url }); + ga.fireEventWithParam(GA_EventName.Rate, "go"); } } const config: ConfigItem[] = [ @@ -44,6 +47,7 @@ import PKG from "../../../cc-plugin.config"; title: "我已评价", click: () => { chrome.storage.local.set({ [HasRate]: true }); + ga.fireEventWithParam(GA_EventName.Rate, "has rate"); }, }, {