Skip to content

Commit

Permalink
Add stub service worker so users can install on desktop with Chrome
Browse files Browse the repository at this point in the history
Signed-off-by: Dale Harvey <dale@arandomurl.com>
  • Loading branch information
daleharvey committed Jan 10, 2020
1 parent 024c019 commit a41484c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions res/sw.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
self.addEventListener('fetch',() => {});
1 change: 1 addition & 0 deletions scripts/copy-res.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const INCLUDE_LANGS = [
// "dest/b/...".
const COPY_LIST = [
["res/manifest.json", "webapp"],
["res/sw.js", "webapp"],
["res/welcome.html", "webapp"],
["res/welcome/**", "webapp/welcome"],
["res/themes/**", "webapp/themes"],
Expand Down
5 changes: 5 additions & 0 deletions src/vector/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
window.vector_indexeddb_worker_script = '<%= htmlWebpackPlugin.files.chunks['indexeddb-worker'].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/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;"/>
Expand Down

0 comments on commit a41484c

Please sign in to comment.