This commit is contained in:
EthanShoeDev
2025-10-04 21:03:01 -04:00
parent 65a5249c8f
commit 8b38104373
7 changed files with 286 additions and 104 deletions

View File

@@ -0,0 +1,14 @@
// This file is only loaded in dev mode.
// These lines should replicate injectedJavaScriptBeforeContentLoaded from src/index.tsx
document.body.style.backgroundColor = '#0B1324';
// Replicate injectedJavaScriptObject from src/index.tsx
window.ReactNativeWebView = {
postMessage: (data: string) => {
console.log('postMessage', data);
},
injectedObjectJson: () => {
return JSON.stringify({});
},
};

View File

@@ -153,7 +153,19 @@ window.onload = () => {
window.addEventListener('message', handler);
// Initial handshake (send once)
setTimeout(() => sendToRn({ type: 'initialized' }), 100);
setTimeout(() => {
const ta = document.querySelector(
'.xterm-helper-textarea',
) as HTMLTextAreaElement | null;
if (!ta) throw new Error('xterm-helper-textarea not found');
ta.setAttribute('autocomplete', 'off');
ta.setAttribute('autocorrect', 'off');
ta.setAttribute('autocapitalize', 'none');
ta.setAttribute('spellcheck', 'false');
ta.setAttribute('inputmode', 'verbatim');
return sendToRn({ type: 'initialized' });
}, 200);
} catch (e) {
sendToRn({
type: 'debug',