Fix: Webview content being dismissed when clicking outside of div area

fix #14
This commit is contained in:
Flávio Caetano 2017-11-30 10:46:39 -02:00
parent f5a4632eb5
commit 78fa352220
2 changed files with 6 additions and 1 deletions

View File

@ -16,7 +16,7 @@ import UIKit
class ViewController: UIViewController {
fileprivate static let webViewTag = 123
// swiftlint:disable force_try
// swiftlint:disable:next force_try
fileprivate let recaptcha = try! ReCaptcha()
fileprivate var disposeBag = DisposeBag()

View File

@ -12,7 +12,12 @@
};
var execute = function() {
// Removes ReCaptcha dismissal when clicking outside div area
document.getElementsByTagName("div")[4].outerHTML = ""
// Listens to changes on the div element that presents the ReCaptcha challenge
observeDOM(document.getElementsByTagName("div")[3], function() {
console.log({action: "showReCaptcha"});
window.webkit.messageHandlers.recaptcha.postMessage({action: "showReCaptcha"});
});