diff options
author | Sami Vänttinen <sami.vanttinen@protonmail.com> | 2021-07-21 18:35:50 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-21 18:35:50 +0300 |
commit | 721aae07ed9a9c11ef8805e53048426e9c7d1e50 (patch) | |
tree | 97f0b2ceeafb00e0ae8811aadfb9520c421413b9 | |
parent | a8774f9f204565129c9ec05bc3eb3d7b14ac7a25 (diff) | |
parent | 6964513dde70ad179d40f137cc154ed187ff6612 (diff) |
Merge pull request #1351 from keepassxreboot/fix/form_detection_from_style_attribute1.7.9
Fix form detection from style attribute
-rwxr-xr-x | keepassxc-browser/content/keepassxc-browser.js | 2 | ||||
-rw-r--r-- | keepassxc-browser/content/ui.js | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/keepassxc-browser/content/keepassxc-browser.js b/keepassxc-browser/content/keepassxc-browser.js index 57cc535..53efd81 100755 --- a/keepassxc-browser/content/keepassxc-browser.js +++ b/keepassxc-browser/content/keepassxc-browser.js @@ -1988,7 +1988,7 @@ kpxcObserverHelper.initObserver = async function() { } else if (mut.removedNodes.length > 0) { kpxcObserverHelper.handleObserverRemove(mut.removedNodes[0]); } - } else if (mut.type === 'attributes' && mut.attributeName === 'class') { + } else if (mut.type === 'attributes' && (mut.attributeName === 'class' || mut.attributeName === 'style')) { // Only accept targets with forms const forms = mut.target.nodeName === 'FORM' ? mut.target : mut.target.getElementsByTagName('form'); if (forms.length === 0 && !kpxcSites.exceptionFound(mut.target.classList)) { diff --git a/keepassxc-browser/content/ui.js b/keepassxc-browser/content/ui.js index c403e8c..d90549e 100644 --- a/keepassxc-browser/content/ui.js +++ b/keepassxc-browser/content/ui.js @@ -127,10 +127,12 @@ kpxcUI.setIconPosition = function(icon, field, rtl = false, segmented = false) { left += size + 10; } - icon.style.top = Pixels(top + document.scrollingElement.scrollTop + offset + 1); + const scrollTop = document.scrollingElement ? document.scrollingElement.scrollTop : 0; + const scrollLeft = document.scrollingElement ? document.scrollingElement.scrollLeft : 0; + icon.style.top = Pixels(top + scrollTop + offset + 1); icon.style.left = rtl - ? Pixels((left + document.scrollingElement.scrollLeft) + offset) - : Pixels(left + document.scrollingElement.scrollLeft + field.offsetWidth - size - offset); + ? Pixels((left + scrollLeft) + offset) + : Pixels(left + scrollLeft + field.offsetWidth - size - offset); }; kpxcUI.deleteHiddenIcons = function(iconList, attr) { |