chayns-api 2.4.22 → 2.4.23
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.
|
@@ -33,7 +33,14 @@ class FrameWrapper {
|
|
|
33
33
|
if (!this.initialized) await this.ready;
|
|
34
34
|
return this.exposedFunctions.addScrollListener(value, callback && comlink.proxy(result => callback(result)));
|
|
35
35
|
},
|
|
36
|
-
addVisibilityChangeListener: async callback =>
|
|
36
|
+
addVisibilityChangeListener: async callback => {
|
|
37
|
+
if (!this.initialized) await this.ready;
|
|
38
|
+
try {
|
|
39
|
+
return await this.exposedFunctions.addVisibilityChangeListener(comlink.proxy(result => callback(result)));
|
|
40
|
+
} catch (ex) {
|
|
41
|
+
return (0, _visibilityChangeListener.addVisibilityChangeListener)(callback);
|
|
42
|
+
}
|
|
43
|
+
},
|
|
37
44
|
addToolbarChangeListener: async callback => {
|
|
38
45
|
if (!this.initialized) await this.ready;
|
|
39
46
|
return this.exposedFunctions.addToolbarChangeListener(callback && comlink.proxy(result => callback(result)));
|
|
@@ -29,7 +29,14 @@ export class FrameWrapper {
|
|
|
29
29
|
if (!this.initialized) await this.ready;
|
|
30
30
|
return this.exposedFunctions.addScrollListener(value, callback && comlink.proxy(result => callback(result)));
|
|
31
31
|
},
|
|
32
|
-
addVisibilityChangeListener: async callback =>
|
|
32
|
+
addVisibilityChangeListener: async callback => {
|
|
33
|
+
if (!this.initialized) await this.ready;
|
|
34
|
+
try {
|
|
35
|
+
return await this.exposedFunctions.addVisibilityChangeListener(comlink.proxy(result => callback(result)));
|
|
36
|
+
} catch (ex) {
|
|
37
|
+
return addVisibilityChangeListener(callback);
|
|
38
|
+
}
|
|
39
|
+
},
|
|
33
40
|
addToolbarChangeListener: async callback => {
|
|
34
41
|
if (!this.initialized) await this.ready;
|
|
35
42
|
return this.exposedFunctions.addToolbarChangeListener(callback && comlink.proxy(result => callback(result)));
|