mirror of
https://github.com/tidys/cc-inspector-chrome
synced 2025-11-03 03:45:25 +00:00
显示Engine版本号
This commit is contained in:
@@ -14,7 +14,13 @@ export class GoogleAnalytics {
|
||||
}
|
||||
return clientId;
|
||||
}
|
||||
private isChromeEnv() {
|
||||
return !!chrome?.storage?.local?.get;
|
||||
}
|
||||
public async fireEventWithParam(name: GA_EventName, param: string) {
|
||||
if (!this.isChromeEnv()) {
|
||||
return;
|
||||
}
|
||||
const time = Date.now();
|
||||
const id = await this.getOrCreateSessionId();
|
||||
fetch(`${GA_ENDPOINT}?measurement_id=${MEASUREMENT_ID}&api_secret=${API_SECRET}`, {
|
||||
@@ -35,6 +41,9 @@ export class GoogleAnalytics {
|
||||
});
|
||||
}
|
||||
public async fireEvent(name: string) {
|
||||
if (!this.isChromeEnv()) {
|
||||
return;
|
||||
}
|
||||
const time = Date.now();
|
||||
const id = await this.getOrCreateSessionId();
|
||||
fetch(`${GA_ENDPOINT}?measurement_id=${MEASUREMENT_ID}&api_secret=${API_SECRET}`, {
|
||||
|
||||
@@ -77,6 +77,7 @@ export enum GA_EventName {
|
||||
MouseMenu = "mouse_menu",
|
||||
Hierarchy = "hierarchy",
|
||||
Inspector = "Inspector",
|
||||
EngineVersion = "engine_version",
|
||||
}
|
||||
export enum GA_Button {
|
||||
Github = "github",
|
||||
|
||||
Reference in New Issue
Block a user