Skip to content

Commit

Permalink
Fix the pwa example (#3664)
Browse files Browse the repository at this point in the history
  • Loading branch information
ealmloff authored Jan 28, 2025
1 parent c850183 commit 4c8e856
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 28 deletions.
42 changes: 15 additions & 27 deletions examples/pwa/index.html
Original file line number Diff line number Diff line change
@@ -1,30 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<title>{app_title}</title>
<script>
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register(
'/sw.js'
);
}
</script>
<link rel="manifest" href="manifest.json">
<meta content="text/html;charset=utf-8" http-equiv="Content-Type" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="UTF-8" />
{style_include}
</head>
<body>
<div id="main"></div>
<script type="module">
import init from "/{base_path}/assets/dioxus/{app_name}.js";
init("/{base_path}/assets/dioxus/{app_name}_bg.wasm").then(wasm => {
if (wasm.__wbindgen_start == undefined) {
wasm.main();
<head>
<title>{app_title}</title>
<script>
if ("serviceWorker" in navigator) {
navigator.serviceWorker.register("/{base_path}/assets/sw.js");
}
});
</script>
{script_include}
</body>
</html>
</script>
<link rel="manifest" href="/assets/manifest.json" />
<meta content="text/html;charset=utf-8" http-equiv="Content-Type" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta charset="UTF-8" />
</head>
<body>
<div id="main"></div>
</body>
</html>
2 changes: 1 addition & 1 deletion examples/pwa/public/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@
"dir": "ltr",
"lang": "en",
"orientation": "portrait"
}
}

0 comments on commit 4c8e856

Please sign in to comment.