mirror of
https://github.com/tidys/cc-inspector-chrome
synced 2025-04-19 16:38:41 +00:00
watch is cocos game
This commit is contained in:
parent
6abafd413c
commit
e2b3cbfe8e
@ -30,9 +30,8 @@ declare const cc: any;
|
|||||||
class CCInspector {
|
class CCInspector {
|
||||||
inspectorGameMemoryStorage: Record<string, any> = {}
|
inspectorGameMemoryStorage: Record<string, any> = {}
|
||||||
|
|
||||||
init() {
|
private watchIsCocosGame() {
|
||||||
console.log("cc-inspector init ~~~");
|
const timer = setInterval(() => {
|
||||||
let timer = setInterval(() => {
|
|
||||||
if (this._isCocosGame()) {
|
if (this._isCocosGame()) {
|
||||||
clearInterval(timer)
|
clearInterval(timer)
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
@ -42,6 +41,11 @@ class CCInspector {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}, 300)
|
}, 300)
|
||||||
|
}
|
||||||
|
|
||||||
|
init() {
|
||||||
|
console.log("cc-inspector init ~~~");
|
||||||
|
this.watchIsCocosGame();
|
||||||
window.addEventListener("message", (event) => {
|
window.addEventListener("message", (event) => {
|
||||||
// 接受来自content的事件,有可能也会受到其他插件的
|
// 接受来自content的事件,有可能也会受到其他插件的
|
||||||
if (!event || !event.data) {
|
if (!event || !event.data) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user