by Eddy Verbruggen - @eddyverbruggen
Apple thought it'd be nice to show a magnifying glass when longpressing the webview on iOS9.
Don't like it? This plugin removes it!
Cordova CLI
$ cordova plugin add cordova-plugin-ios-longpress-fix
PhoneGap Build
<gap:plugin name="cordova-plugin-ios-longpress-fix" source="npm" />
It just works, and will proudly shout that at the XCode console when it does.
You can also suppress 3D Touch longpresses (those will also popup the magnifying glass), but since it requires a bit of caution I've made it optional.
The caveat is onclick
taps must be completed in under 80ms (otherwise they are hijacked by this plugin) which is too short for most users.
But if you're using ontouchend
there's no problem.
If you want to enable this feature, add this to config.xml
:
<preference name="Suppress3DTouch" value="true" />
Currently only works with UIWebView, not WKWebView, but you should be able to suppress the magnifying glass on WKWebView with a few lines of CSS.
I'm working with Cordova guys to get this in their distribution as standard.
UPDATE: It's in there, so you might as well use that :)