Enable pinch to zoom inside iframe - Ionic 2 AngularJS 2 Enable pinch to zoom inside iframe - Ionic 2 AngularJS 2 angular angular

Enable pinch to zoom inside iframe - Ionic 2 AngularJS 2


You will need to track the gesture and apply the change of zoom to the iframe like this document.getElementByTagName('iframe').contentWindow.document.body.style = 'zoom:50%';

Here the zoom is set to 50%, but this can be added dynamically using the gesture event values.


I think it is not possible to do in a IFrame as that will be a security flaw.what you are basically doing is trying to access a webpage from your mobile hybrid app (Ionic App in your case).it must not allow you to run javascript on that webpage, workaround for it will be by disabling web security on that browser or in your case webview (not sure how to do that in mobile but that is manual browser customization so will not work in your scenario).

more explanation on this post SecurityError: Blocked a frame with origin from accessing a cross-origin frame