Skip to content

Commit

Permalink
Merge pull request #3330 from Bluebugs/features/chrome-version-check
Browse files Browse the repository at this point in the history
With Chrome 106 it is now possible to run fyne wasm output.
  • Loading branch information
Bluebugs authored Oct 15, 2022
2 parents 2d7554e + d6d069e commit 78f6dd9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
6 changes: 3 additions & 3 deletions cmd/fyne/internal/templates/bundled.go

Large diffs are not rendered by default.

12 changes: 10 additions & 2 deletions cmd/fyne/internal/templates/data/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,17 @@
{{end}}
{{if .HasWasm}}
<script>
function getChromeVersion() {
var raw = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);

return raw ? parseInt(raw[2], 10) : 0;
}

var wasmBuild = true;
if (window.chrome) {
wasmBuild = false;
if (getChromeVersion() < 106) {
wasmBuild = false;
}
}
</script>
{{else}}
Expand All @@ -67,7 +75,7 @@
}

function webgl_support () {
try {
try {
var canvas = document.createElement('canvas');
return !!window.WebGLRenderingContext &&
(canvas.getContext('webgl') || canvas.getContext('experimental-webgl'));
Expand Down

0 comments on commit 78f6dd9

Please sign in to comment.