Skip to content

Commit 4550c52

Browse files
committed
2 parents 7943360 + 0414c47 commit 4550c52

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

index.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,9 @@ const injectedScript = function() {
2525
setTimeout(waitForBridge, 200);
2626
}
2727
else {
28-
let height = 0;
29-
if(document.documentElement.clientHeight>document.body.clientHeight)
30-
{
31-
height = document.documentElement.clientHeight
32-
}
33-
else
34-
{
35-
height = document.body.clientHeight
36-
}
37-
postMessage(height)
28+
postMessage(
29+
Math.max(document.documentElement.clientHeight, document.documentElement.scrollHeight, document.body.clientHeight, document.body.scrollHeight)
30+
)
3831
}
3932
}
4033
waitForBridge();
@@ -68,6 +61,10 @@ export default class MyWebView extends Component {
6861
this.webview.stopLoading();
6962
}
7063

64+
reload() {
65+
this.webview.reload();
66+
}
67+
7168
render () {
7269
const _w = this.props.width || Dimensions.get('window').width;
7370
const _h = this.props.autoHeight ? this.state.webViewHeight : this.props.defaultHeight;

0 commit comments

Comments
 (0)