We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 149a5d0 commit 161d25eCopy full SHA for 161d25e
packages/app/src/app/index.js
@@ -231,3 +231,19 @@ if (module.hot) {
231
);
232
});
233
}
234
+
235
+const isInStandaloneMode = () =>
236
+ 'standalone' in window.navigator && window.navigator.standalone;
237
238
+// If we're in PWA mode we want to override CMD+W, so that people can use that to close the tabs. This is a little
239
+// hack, but gives good QoL improvement for a small effort.
240
+if (isInStandaloneMode()) {
241
+ document.addEventListener('keydown', e => {
242
+ if (
243
+ (window.navigator.platform.match('Mac') ? e.metaKey : e.ctrlKey) &&
244
+ e.keyCode === 83
245
+ ) {
246
+ e.preventDefault();
247
+ }
248
+ });
249
+}
0 commit comments