forked from matrix/element-web
Add stub service worker so users can install on desktop with Chrome
Signed-off-by: Dale Harvey <dale@arandomurl.com>
This commit is contained in:
parent
024c019c5b
commit
a41484cb35
|
@ -58,6 +58,7 @@ const INCLUDE_LANGS = [
|
||||||
// "dest/b/...".
|
// "dest/b/...".
|
||||||
const COPY_LIST = [
|
const COPY_LIST = [
|
||||||
["res/manifest.json", "webapp"],
|
["res/manifest.json", "webapp"],
|
||||||
|
["res/sw.js", "webapp"],
|
||||||
["res/welcome.html", "webapp"],
|
["res/welcome.html", "webapp"],
|
||||||
["res/welcome/**", "webapp/welcome"],
|
["res/welcome/**", "webapp/welcome"],
|
||||||
["res/themes/**", "webapp/themes"],
|
["res/themes/**", "webapp/themes"],
|
||||||
|
|
|
@ -41,6 +41,11 @@
|
||||||
window.vector_indexeddb_worker_script = '<%= htmlWebpackPlugin.files.chunks['indexeddb-worker'].entry %>';
|
window.vector_indexeddb_worker_script = '<%= htmlWebpackPlugin.files.chunks['indexeddb-worker'].entry %>';
|
||||||
</script>
|
</script>
|
||||||
<script src="<%= htmlWebpackPlugin.files.chunks['bundle'].entry %>"></script>
|
<script src="<%= htmlWebpackPlugin.files.chunks['bundle'].entry %>"></script>
|
||||||
|
<script>
|
||||||
|
if ('serviceWorker' in navigator) {
|
||||||
|
navigator.serviceWorker.register('sw.js');
|
||||||
|
}
|
||||||
|
</script>
|
||||||
<img src="<%= require('matrix-react-sdk/res/img/warning.svg') %>" width="24" height="23" style="visibility: hidden; position: absolute; top: 0px; left: 0px;"/>
|
<img src="<%= require('matrix-react-sdk/res/img/warning.svg') %>" width="24" height="23" style="visibility: hidden; position: absolute; top: 0px; left: 0px;"/>
|
||||||
<img src="<%= require('matrix-react-sdk/res/img/e2e/warning.svg') %>" width="24" height="23" style="visibility: hidden; position: absolute; top: 0px; left: 0px;"/>
|
<img src="<%= require('matrix-react-sdk/res/img/e2e/warning.svg') %>" width="24" height="23" style="visibility: hidden; position: absolute; top: 0px; left: 0px;"/>
|
||||||
<img src="<%= require('matrix-react-sdk/res/img/feather-customised/warning-triangle.svg') %>" width="24" height="23" style="visibility: hidden; position: absolute; top: 0px; left: 0px;"/>
|
<img src="<%= require('matrix-react-sdk/res/img/feather-customised/warning-triangle.svg') %>" width="24" height="23" style="visibility: hidden; position: absolute; top: 0px; left: 0px;"/>
|
||||||
|
|
Loading…
Reference in New Issue