mirror of
https://github.com/AeThex-Corporation/AeThex-OS.git
synced 2026-04-17 22:27:19 +00:00
fix(webview): use test_script_head.html to isolate script in head
This commit is contained in:
parent
01145ad755
commit
287a9a4523
2 changed files with 34 additions and 1 deletions
33
android/app/src/main/assets/public/test_script_head.html
Normal file
33
android/app/src/main/assets/public/test_script_head.html
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no, viewport-fit=cover" />
|
||||||
|
<title>Test Script Head</title>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
background-color: orange;
|
||||||
|
color: black;
|
||||||
|
font-size: 40px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
height: 100vh;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script>
|
||||||
|
console.log("Test Script Head loaded");
|
||||||
|
// This script runs BEFORE the body exists.
|
||||||
|
// It's the only difference from test_red.html
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div>
|
||||||
|
<h1>TEST SCRIPT HEAD LOADED (Orange)</h1>
|
||||||
|
<p>If you see this, script in HEAD is safe.</p>
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
document.body.style.backgroundColor = "orange";
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -70,6 +70,6 @@ public class MainActivity extends BridgeActivity {
|
||||||
// SWITCH TO REAL APP
|
// SWITCH TO REAL APP
|
||||||
// Using "file:///android_asset/public/" base path which matches the physical structure
|
// Using "file:///android_asset/public/" base path which matches the physical structure
|
||||||
// AND ensuring we load index.html
|
// AND ensuring we load index.html
|
||||||
webView.loadUrl("file:///android_asset/public/test_red.html");
|
webView.loadUrl("file:///android_asset/public/test_script_head.html");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue