Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nit: add a wasm-shell for fullscreen embedding #8719

Merged
merged 2 commits into from
Dec 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions wasm/embedded.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<!doctype html>
<html lang="en-us">
<script>



</script>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
<title>Mozilla VPN - WebAssembly Viewer</title>
<link rel="icon" type="image/png" href="favicon.ico">
</head>
<body onload="mvpnWasm.init()" class="wasm-loading">
<canvas id="qmlcanvas" oncontextmenu="event.preventDefault()" contenteditable="false" tabindex="-1"></canvas>
<div id="qtstatus" style="display: none;"></div>
<div id="preset" style="display: none;"></div>
<button id="backButton" style="display: none;"></button>
<canvas id="controlcanvas" width="0" height="0" style="display: none;"></canvas>
<script type="text/javascript" src="fxa_endpoints.js"></script>
<script type="text/javascript" src="guardian_endpoints.js"></script>
<script type="text/javascript" src="controller.js"></script>
<script type="text/javascript" src="presets.js"></script>
<script type="text/javascript" src="main.js"></script>
<script type="text/javascript" src="qtloader.js"></script>
</body>
<style>
html,
body {
padding: 0;
margin : 0;
height: 100vh;
width: 100vw;
background-color: black;
overflow-y: hidden;
overflow-x: hidden;
}
canvas{
cursor: default !important;
height: 100vh;
width: 100vw;
}
</style>
<script>
let planned_resize = false;

const resizeCanvas = ()=>{
if(planned_resize){return;}
planned_resize=true
const canvas = document.querySelector("#qmlcanvas")
requestAnimationFrame(()=>{

canvas.height = window.innerHeight /window.devicePixelRatio;
canvas.width = window.innerWidth / window.devicePixelRatio;
planned_resize = false;
})
}

window.addEventListener("resize", resizeCanvas, {passive:true});
window.addEventListener("load", resizeCanvas, {passive:true});

</script>
</html>

Loading