Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Added documentation for the syntheticClick API.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon-T committed Mar 24, 2020
1 parent f244ee7 commit 1948610
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,13 @@ extension BrowserViewController: WKNavigationDelegate {
// Prevents synthetically activated links such as: CVE-2017-7089
if ["data", "blob", "file"].contains(url.scheme) {
if let clickType = navigationAction.value(forKey: "syntheticClickType") as? Int {
//A click is synthetic if its value is 0 (aka WKSyntheticClickTypeNoTap).
/*switch (syntheticClickType) {
case WebKit::WebMouseEvent::OneFingerTap:
return WKSyntheticClickTypeOneFingerTap;
case WebKit::WebMouseEvent::TwoFingerTap:
return WKSyntheticClickTypeTwoFingerTap;
}*/
if clickType == 0 {
decisionHandler(.cancel)
return
Expand Down

0 comments on commit 1948610

Please sign in to comment.