@jolibox/implement 1.4.14 → 1.4.16
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/.rush/temp/package-deps_build.json +5 -5
- package/dist/index.js +2 -2
- package/dist/index.native.js +5 -5
- package/implement.build.log +2 -2
- package/package.json +6 -6
- package/src/common/report/task-track/index.ts +3 -2
- package/src/common/utils/index.ts +12 -9
- package/src/h5/api/task.ts +3 -2
- package/src/native/bootstrap/index.ts +5 -0
package/implement.build.log
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Invoking: npm run clean && npm run build:esm && tsc
|
|
2
2
|
|
|
3
|
-
> @jolibox/implement@1.4.
|
|
3
|
+
> @jolibox/implement@1.4.16 clean
|
|
4
4
|
> rimraf ./dist
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
> @jolibox/implement@1.4.
|
|
7
|
+
> @jolibox/implement@1.4.16 build:esm
|
|
8
8
|
> BUILD_VERSION=$(node -p "require('./package.json').version") node esbuild.config.js --format=esm
|
|
9
9
|
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jolibox/implement",
|
|
3
3
|
"description": "This project is Jolibox JS-SDk implement for Native && H5",
|
|
4
|
-
"version": "1.4.
|
|
4
|
+
"version": "1.4.16",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@jolibox/common": "1.4.
|
|
10
|
-
"@jolibox/types": "1.4.
|
|
11
|
-
"@jolibox/native-bridge": "1.4.
|
|
12
|
-
"@jolibox/ads": "1.4.
|
|
9
|
+
"@jolibox/common": "1.4.16",
|
|
10
|
+
"@jolibox/types": "1.4.16",
|
|
11
|
+
"@jolibox/native-bridge": "1.4.16",
|
|
12
|
+
"@jolibox/ads": "1.4.16",
|
|
13
13
|
"localforage": "1.10.0",
|
|
14
|
-
"@jolibox/ui": "1.4.
|
|
14
|
+
"@jolibox/ui": "1.4.16",
|
|
15
15
|
"web-vitals": "4.2.4"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
@@ -34,8 +34,9 @@ export abstract class TaskTracker {
|
|
|
34
34
|
private reportCount = 0; // 添加上报次数计数
|
|
35
35
|
|
|
36
36
|
protected notifyIframeGameEvent = (eventName: string, data: any) => {
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
const parentWindow = window.parent;
|
|
38
|
+
if (parentWindow && parentWindow !== window && typeof parentWindow.postMessage === 'function') {
|
|
39
|
+
parentWindow.postMessage(
|
|
39
40
|
{
|
|
40
41
|
type: eventName,
|
|
41
42
|
data
|
|
@@ -69,15 +69,18 @@ interface JoliboxCustomEvent {
|
|
|
69
69
|
|
|
70
70
|
const notifyCustomEvent = <T extends keyof JoliboxCustomEvent>(eventName: T, data: JoliboxCustomEvent[T]) => {
|
|
71
71
|
window.dispatchEvent(new CustomEvent(eventName, { detail: data }));
|
|
72
|
-
window.parent
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
72
|
+
const parentWindow = window.parent;
|
|
73
|
+
if (parentWindow && parentWindow !== window && typeof parentWindow.postMessage === 'function') {
|
|
74
|
+
parentWindow.postMessage(
|
|
75
|
+
{
|
|
76
|
+
type: eventName,
|
|
77
|
+
data: {
|
|
78
|
+
detail: data
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
'*'
|
|
82
|
+
);
|
|
83
|
+
}
|
|
81
84
|
};
|
|
82
85
|
|
|
83
86
|
/**
|
package/src/h5/api/task.ts
CHANGED
|
@@ -11,8 +11,9 @@ enum ECrossFrameEvent {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
const notifyIframeGameTaskEvent = (eventName: string, data: any) => {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
const parentWindow = window.parent;
|
|
15
|
+
if (parentWindow && parentWindow !== window && typeof parentWindow.postMessage === 'function') {
|
|
16
|
+
parentWindow.postMessage(
|
|
16
17
|
{
|
|
17
18
|
type: eventName,
|
|
18
19
|
data
|
|
@@ -196,6 +196,11 @@ function addDoExitLoader() {
|
|
|
196
196
|
return true; // Forbid exit on watching ads
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
+
if (context.platform === 'ios') {
|
|
200
|
+
doActualExit();
|
|
201
|
+
return false;
|
|
202
|
+
}
|
|
203
|
+
|
|
199
204
|
// 指定退出挽留逻辑,则按照指定逻辑运行
|
|
200
205
|
if (isBoolean(context.shouldInterupt)) {
|
|
201
206
|
// 不需要打断退出,上报埋点
|