1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-24 12:46:35 +01:00

Fix comparing tagName in form observer

Listen also to subtree mutations

Closes #2321
This commit is contained in:
David Rosca 2017-05-29 15:47:16 +02:00
parent 0747379114
commit 57172459d8

View File

@ -1,6 +1,6 @@
/* ============================================================
* QupZilla - WebKit based browser
* Copyright (C) 2015-2016 David Rosca <nowrep@gmail.com>
* Copyright (C) 2015-2017 David Rosca <nowrep@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -115,10 +115,10 @@ QString Scripts::setupFormObserver()
"var observer = new MutationObserver(function(mutations) {"
" for (var i = 0; i < mutations.length; ++i)"
" for (var j = 0; j < mutations[i].addedNodes.length; ++j)"
" if (mutations[i].addedNodes[j].tagName == 'form')"
" if (mutations[i].addedNodes[j].tagName == 'FORM')"
" registerForm(mutations[i].addedNodes[j]);"
"});"
"observer.observe(document.documentElement, { childList: true });"
"observer.observe(document.documentElement, { childList: true, subtree: true });"
""
"})()");