|
@@ -23,7 +23,7 @@ import Immutable from "immutable";
|
23
|
23
|
const RCTAutoHeightWebView = requireNativeComponent(
|
24
|
24
|
"RCTAutoHeightWebView",
|
25
|
25
|
AutoHeightWebView,
|
26
|
|
- { nativeOnly:
|
|
26
|
+ { nativeOnly:
|
27
|
27
|
{
|
28
|
28
|
nativeOnly: {
|
29
|
29
|
onLoadingStart: true,
|
|
@@ -343,12 +343,28 @@ const BaseScript = IsBelowKitKat
|
343
|
343
|
AutoHeightWebView.onMessage = function (message) {
|
344
|
344
|
AutoHeightWebView.send(String(document.body.offsetHeight));
|
345
|
345
|
};
|
346
|
|
- } ());
|
|
346
|
+ MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
|
|
347
|
+ var observer = new MutationObserver(function() {
|
|
348
|
+ AutoHeightWebView.send(String(document.body.offsetHeight));
|
|
349
|
+ });
|
|
350
|
+ observer.observe(document, {
|
|
351
|
+ subtree: true,
|
|
352
|
+ attributes: true
|
|
353
|
+ });
|
|
354
|
+ } ());
|
347
|
355
|
`
|
348
|
356
|
: `
|
349
|
357
|
; (function () {
|
350
|
358
|
document.addEventListener('message', function (e) {
|
351
|
359
|
window.postMessage(String(document.body.offsetHeight));
|
352
|
360
|
});
|
353
|
|
- } ());
|
|
361
|
+ MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
|
|
362
|
+ var observer = new MutationObserver(function() {
|
|
363
|
+ window.postMessage(String(document.body.offsetHeight));
|
|
364
|
+ });
|
|
365
|
+ observer.observe(document, {
|
|
366
|
+ subtree: true,
|
|
367
|
+ attributes: true
|
|
368
|
+ });
|
|
369
|
+ } ());
|
354
|
370
|
`;
|