@kokimoki/app 1.4.3 → 1.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/kokimoki-client.js +9 -9
- package/dist/kokimoki.min.js +10 -10
- package/dist/kokimoki.min.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/kokimoki-client.js
CHANGED
|
@@ -55,7 +55,7 @@ export class KokimokiClient extends EventEmitter {
|
|
|
55
55
|
}
|
|
56
56
|
}, 5000);
|
|
57
57
|
// Listen for devtools messages
|
|
58
|
-
if (window.top) {
|
|
58
|
+
if (window.top && window.self !== window.top) {
|
|
59
59
|
window.addEventListener("message", (e) => {
|
|
60
60
|
console.log(`[KM TOOLS] ${e.data}`);
|
|
61
61
|
if (e.data === "km:clearStorage") {
|
|
@@ -118,17 +118,16 @@ export class KokimokiClient extends EventEmitter {
|
|
|
118
118
|
return await this._connectPromise;
|
|
119
119
|
}
|
|
120
120
|
// Detect devtools
|
|
121
|
-
if (window.top) {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
// Wait up to 50ms for parent to respond
|
|
121
|
+
if (window.top && window.self !== window.top) {
|
|
122
|
+
await new Promise((resolve) => {
|
|
123
|
+
/* // Wait up to 500ms for parent to respond
|
|
125
124
|
const timeout = setTimeout(() => {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
},
|
|
125
|
+
window.removeEventListener("message", onMessage);
|
|
126
|
+
resolve();
|
|
127
|
+
}, 500); */
|
|
129
128
|
// Listen for parent response
|
|
130
129
|
const onMessage = (e) => {
|
|
131
|
-
clearTimeout(timeout);
|
|
130
|
+
// clearTimeout(timeout);
|
|
132
131
|
window.removeEventListener("message", onMessage);
|
|
133
132
|
if (e.data.clientKey) {
|
|
134
133
|
this._clientTokenKey = `KM_TOKEN/${e.data.clientKey}`;
|
|
@@ -136,6 +135,7 @@ export class KokimokiClient extends EventEmitter {
|
|
|
136
135
|
resolve();
|
|
137
136
|
};
|
|
138
137
|
window.addEventListener("message", onMessage);
|
|
138
|
+
window.top.postMessage({ appId: this.appId }, "*");
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
141
|
// Set up the WebSocket connection
|
package/dist/kokimoki.min.js
CHANGED
|
@@ -634,7 +634,7 @@ function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
|
|
|
634
634
|
var eventsExports = events.exports;
|
|
635
635
|
var EventEmitter$1 = /*@__PURE__*/getDefaultExportFromCjs(eventsExports);
|
|
636
636
|
|
|
637
|
-
const KOKIMOKI_APP_VERSION = "1.4.
|
|
637
|
+
const KOKIMOKI_APP_VERSION = "1.4.4";
|
|
638
638
|
|
|
639
639
|
/**
|
|
640
640
|
* Utility module to work with key-value stores.
|
|
@@ -12268,7 +12268,7 @@ class KokimokiClient extends EventEmitter$1 {
|
|
|
12268
12268
|
}
|
|
12269
12269
|
}, 5000);
|
|
12270
12270
|
// Listen for devtools messages
|
|
12271
|
-
if (window.top) {
|
|
12271
|
+
if (window.top && window.self !== window.top) {
|
|
12272
12272
|
window.addEventListener("message", (e) => {
|
|
12273
12273
|
console.log(`[KM TOOLS] ${e.data}`);
|
|
12274
12274
|
if (e.data === "km:clearStorage") {
|
|
@@ -12331,17 +12331,16 @@ class KokimokiClient extends EventEmitter$1 {
|
|
|
12331
12331
|
return await this._connectPromise;
|
|
12332
12332
|
}
|
|
12333
12333
|
// Detect devtools
|
|
12334
|
-
if (window.top) {
|
|
12335
|
-
|
|
12336
|
-
|
|
12337
|
-
// Wait up to 50ms for parent to respond
|
|
12334
|
+
if (window.top && window.self !== window.top) {
|
|
12335
|
+
await new Promise((resolve) => {
|
|
12336
|
+
/* // Wait up to 500ms for parent to respond
|
|
12338
12337
|
const timeout = setTimeout(() => {
|
|
12339
|
-
|
|
12340
|
-
|
|
12341
|
-
},
|
|
12338
|
+
window.removeEventListener("message", onMessage);
|
|
12339
|
+
resolve();
|
|
12340
|
+
}, 500); */
|
|
12342
12341
|
// Listen for parent response
|
|
12343
12342
|
const onMessage = (e) => {
|
|
12344
|
-
clearTimeout(timeout);
|
|
12343
|
+
// clearTimeout(timeout);
|
|
12345
12344
|
window.removeEventListener("message", onMessage);
|
|
12346
12345
|
if (e.data.clientKey) {
|
|
12347
12346
|
this._clientTokenKey = `KM_TOKEN/${e.data.clientKey}`;
|
|
@@ -12349,6 +12348,7 @@ class KokimokiClient extends EventEmitter$1 {
|
|
|
12349
12348
|
resolve();
|
|
12350
12349
|
};
|
|
12351
12350
|
window.addEventListener("message", onMessage);
|
|
12351
|
+
window.top.postMessage({ appId: this.appId }, "*");
|
|
12352
12352
|
});
|
|
12353
12353
|
}
|
|
12354
12354
|
// Set up the WebSocket connection
|