android: webview shell mode

This commit is contained in:
pengfei.zhou
2021-11-08 15:19:55 +08:00
committed by osborn
parent b7935e48c7
commit c7252613a2
5 changed files with 157 additions and 24 deletions

View File

@@ -2,11 +2,12 @@
<html>
<head>
<meta charset="UTF-8" />
<title>这是一个HTML5的网页</title>
<title>Web shell for doric</title>
</head>
<body>
<p>Hello HTML5</p>
</body>
<script type="text/javascript" src="http://shell.doric/doric-web.js"></script>
<script type="text/javascript">
function addScriptElement(scriptId, source) {
const scriptElement = document.createElement("script");
@@ -15,9 +16,12 @@
scriptElement.src = source;
document.body.appendChild(scriptElement);
}
function removeScriptElement(scriptId) {
const scriptElement = document.getElementById(scriptId);
document.body.removeChild(scriptElement);
}
NativeClient.ready();
</script>
</html>

View File

@@ -2,9 +2,25 @@
<html>
<head>
<meta charset="UTF-8" />
<title>这是一个HTML5的网页</title>
<title>Web shell for doric</title>
</head>
<body>
<p>Hello HTML5</p>
</body>
<script type="text/javascript">
function addScriptElement(scriptId, source) {
const scriptElement = document.createElement("script");
scriptElement.type = "text/javascript";
scriptElement.id = scriptId;
scriptElement.src = source;
document.body.appendChild(scriptElement);
}
function removeScriptElement(scriptId) {
const scriptElement = document.getElementById(scriptId);
document.body.removeChild(scriptElement);
}
NativeClient.ready();
</script>
</html>