Skip to content

Commit

Permalink
Fix: Webview content being dismissed when clicking outside of div area
Browse files Browse the repository at this point in the history
fix #14
  • Loading branch information
fjcaetano committed Nov 30, 2017
1 parent f5a4632 commit 78fa352
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Example/ReCaptcha/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
5 changes: 5 additions & 0 deletions ReCaptcha/Assets/recaptcha.html
Original file line number Diff line number Diff line change
Expand Up @@ -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"});
});

Expand Down

0 comments on commit 78fa352

Please sign in to comment.