@webview-bridge/web 1.4.3-nightly.0 → 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/commonjs/index.cjs
CHANGED
|
@@ -199,6 +199,15 @@ var linkBridgeStore = (initialState = {}) => {
|
|
|
199
199
|
emitter.on("bridgeStateChange", (data) => {
|
|
200
200
|
setState(data);
|
|
201
201
|
});
|
|
202
|
+
document.addEventListener("visibilitychange", () => {
|
|
203
|
+
if (document.visibilityState === "visible") {
|
|
204
|
+
window.ReactNativeWebView?.postMessage(
|
|
205
|
+
JSON.stringify({
|
|
206
|
+
type: "getBridgeState"
|
|
207
|
+
})
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
});
|
|
202
211
|
window.ReactNativeWebView?.postMessage(
|
|
203
212
|
JSON.stringify({
|
|
204
213
|
type: "getBridgeState"
|
package/dist/module/index.mjs
CHANGED
|
@@ -169,6 +169,15 @@ var linkBridgeStore = (initialState = {}) => {
|
|
|
169
169
|
emitter.on("bridgeStateChange", (data) => {
|
|
170
170
|
setState(data);
|
|
171
171
|
});
|
|
172
|
+
document.addEventListener("visibilitychange", () => {
|
|
173
|
+
if (document.visibilityState === "visible") {
|
|
174
|
+
window.ReactNativeWebView?.postMessage(
|
|
175
|
+
JSON.stringify({
|
|
176
|
+
type: "getBridgeState"
|
|
177
|
+
})
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
});
|
|
172
181
|
window.ReactNativeWebView?.postMessage(
|
|
173
182
|
JSON.stringify({
|
|
174
183
|
type: "getBridgeState"
|