From 8f30ec7b8d7bbaf557d611c86ced5e6a9cc807b9 Mon Sep 17 00:00:00 2001 From: mxb Date: Tue, 23 Apr 2019 18:25:42 +0200 Subject: [PATCH] Added script fix --- app/view/main/MainController.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/view/main/MainController.js b/app/view/main/MainController.js index c338cf9c..5dd908aa 100644 --- a/app/view/main/MainController.js +++ b/app/view/main/MainController.js @@ -373,6 +373,15 @@ Ext.define('Rambox.view.main.MainController', { } function setLock(text) { + var currentTab = Ext.cq1('app-main').getActiveTab(); + if (currentTab.getWebView) { //related to https://github.com/ramboxapp/community-edition/issues/2065. Focusing in an sub frame is a workaround + currentTab.down('component').el.dom.executeJavaScript(` + var iframeFix = document.createElement('iframe'); + document.body.appendChild(iframeFix); + iframeFix.focus(); + document.body.removeChild(iframeFix); + `); + } console.info('Lock Rambox:', 'Enabled'); // Save encrypted password in localStorage to show locked when app is reopen