From 143ad1a23f47cce34dae8207d6515e44527d13bb Mon Sep 17 00:00:00 2001 From: Andy Stewart Date: Sun, 22 Mar 2020 23:18:17 +0800 Subject: [PATCH] Fix #253 --- core/js/get_focus_text.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/js/get_focus_text.js b/core/js/get_focus_text.js index 636e019..cc9dcaa 100644 --- a/core/js/get_focus_text.js +++ b/core/js/get_focus_text.js @@ -2,7 +2,11 @@ const activeElement = document.activeElement; var inputs = ["input", "select", "textarea"]; - if (activeElement && inputs.indexOf(activeElement.tagName.toLowerCase()) !== -1) { + if (window.location.href === "https://mail.qq.com/" && activeElement) { + // QQ mail have some security mechanism that we can't fetch value of activeElement. + // So we just return empty string make is_focus method works well in browser.py + return ""; + } else if (activeElement && inputs.indexOf(activeElement.tagName.toLowerCase()) !== -1) { return activeElement.value; } else { if (window.location.href.startsWith("https://web.telegram.org/") && activeElement.hasAttribute("placeholder")) {