Bug 146901 - Override preventDefault() of touch/gestures in iOS Content Blocker
Summary: Override preventDefault() of touch/gestures in iOS Content Blocker
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: iPhone / iPad Other
: P2 Enhancement
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-07-13 07:53 PDT by Dean Murphy
Modified: 2015-07-13 12:19 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dean Murphy 2015-07-13 07:53:46 PDT
Some websites are using preventDefault() on touch/gesture evens within javascript to prevent the callout menu.

For example: If you visit news.google.com on an iPhone, you are unable to long-tap the hyperlinks to copy link/open in new tab/add to reading list. The only workaround I can find for this particular website is to refresh into a desktop view.

The particular script that handles these events can be blocked via content blocker, however blocking the whole script affects the page loading correctly as overriding touch handlers are a small part of what the script as a whole does. 

Maybe have an option within the blockerList.json to ignore 'preventDefault()' of touch/gesture overrides?
Comment 1 Benjamin Poulain 2015-07-13 12:12:16 PDT
This one is very tricky.

There are many valid use cases for calling preventDefault() on touch events. I suspect we would mostly break content if rules start ignore it.

A problem is that we do not provide a way for the page to only cancel certain native gestures. It is quite possible the long press is only cancelled as a by-product of another gesture handling.

I'll import this too to keep track of this particular problem, but IMHO extending the platform should have the priority.
Comment 2 Radar WebKit Bug Importer 2015-07-13 12:19:19 PDT
<rdar://problem/21798014>