commit before switching this from static site to app
This commit is contained in:
69
public/emulator.html
Normal file
69
public/emulator.html
Normal file
@@ -0,0 +1,69 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>EmulatorJS Player</title>
|
||||
<!-- Explicitly invoke COOP/COEP isolation from the sandbox boundary to guarantee SharedArrayBuffer inheritance for MSX -->
|
||||
<script src="/coi-serviceworker.min.js"></script>
|
||||
<style>
|
||||
body, html {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: black;
|
||||
overflow: hidden;
|
||||
}
|
||||
#game {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="game"></div>
|
||||
<script>
|
||||
(function() {
|
||||
let config = {};
|
||||
try {
|
||||
config = JSON.parse(decodeURIComponent(window.location.hash.substring(1)));
|
||||
} catch (e) {
|
||||
console.error('EmulatorJS: Failed to parse hash config', e);
|
||||
}
|
||||
|
||||
window.EJS_player = '#game';
|
||||
window.EJS_gameUrl = config.gameUrl;
|
||||
window.EJS_core = config.core || config.system;
|
||||
window.EJS_pathtodata = 'https://cdn.emulatorjs.org/stable/data/';
|
||||
window.EJS_startOnLoaded = true;
|
||||
if (config.biosUrl) {
|
||||
window.EJS_biosUrl = config.biosUrl;
|
||||
}
|
||||
|
||||
const handleSave = (data) => {
|
||||
const blobContent = data.data || data;
|
||||
window.parent.postMessage({ type: 'EJS_SAVE', data: blobContent }, '*');
|
||||
};
|
||||
|
||||
const handleExit = () => {
|
||||
window.parent.postMessage({ type: 'EJS_EXIT' }, '*');
|
||||
};
|
||||
|
||||
window.EJS_conf = {
|
||||
...config,
|
||||
dataPath: 'https://cdn.emulatorjs.org/stable/data/',
|
||||
onSave: handleSave,
|
||||
onExit: handleExit
|
||||
};
|
||||
})();
|
||||
</script>
|
||||
|
||||
<!-- Official Static Loader Tag (CDN) -->
|
||||
<script src="https://cdn.emulatorjs.org/stable/data/loader.js"></script>
|
||||
|
||||
<script>
|
||||
window.parent.postMessage({ type: 'EJS_READY' }, '*');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user