diff --git a/app/scripts/util/feature-detector.js b/app/scripts/util/feature-detector.js index 2e39cfe7..c51c3abc 100644 --- a/app/scripts/util/feature-detector.js +++ b/app/scripts/util/feature-detector.js @@ -9,6 +9,7 @@ const FeatureDetector = { isPopup: !!((window.parent !== window.top) || window.opener), isStandalone: !!navigator.standalone, isBeta: window.location.href.toLowerCase().indexOf('beta.') > 0, + needFixClicks: /Edge\/14/.test(navigator.appVersion), actionShortcutSymbol: function(formatting) { return this.isMac ? '⌘' : formatting ? 'ctrl + ' : 'ctrl-'; diff --git a/app/scripts/views/app-view.js b/app/scripts/views/app-view.js index 2aa64935..25a364b6 100644 --- a/app/scripts/views/app-view.js +++ b/app/scripts/views/app-view.js @@ -98,6 +98,7 @@ const AppView = Backbone.View.extend({ setInterval(this.syncAllByTimer.bind(this), Timeouts.AutoSync); this.setWindowClass(); + this.fixClicksInEdge(); }, setWindowClass: function() { @@ -110,6 +111,18 @@ const AppView = Backbone.View.extend({ } }, + fixClicksInEdge: function() { + // MS Edge doesn't want to handle clicks by default + // TODO: remove once Edge 14 share drops enough + // https://github.com/keeweb/keeweb/issues/636 + // https://github.com/keeweb/keeweb/issues/636#issuecomment-304225634 + // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/5782378/ + if (FeatureDetector.needFixClicks) { + const msEdgeScrewer = $('').appendTo(this.$el).focus(); + msEdgeScrewer.remove(); + } + }, + render: function () { this.$el.html(this.template({ beta: this.model.isBeta, @@ -277,6 +290,7 @@ const AppView = Backbone.View.extend({ } else { this.showOpenFile(); } + this.fixClicksInEdge(); }, showFileSettings: function(e) {