Created
June 13, 2023 21:04
-
-
Save pachun/8f6e6ae87fb68b6906aa35f89bcaab21 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const injectedJavascript = [ | |
"setTimeout(function() {", | |
" const metaTag = document.createElement('meta');", | |
" metaTag.setAttribute('name', 'viewport');", | |
" metaTag.setAttribute('content', 'width=device-width, initial-scale=1');", | |
" document.getElementsByTagName('head')[0].appendChild(metaTag);", | |
" setTimeout(function() {", | |
" const documentSize = { displayedMessageContentHeight: document.body.scrollHeight };", | |
" const serializedDocumentSize = JSON.stringify(documentSize);", | |
" window.ReactNativeWebView.postMessage(serializedDocumentSize);", | |
" }, 50);", | |
"}, 50);", | |
].join("") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment