Enable pinch to zoom inside iframe

I’ve already asked this same question on Stackoverflow (Question Here) but I didn’t solve it.

I added zooming="true" inside the tag but when the page is loaded I cannot zoom to increase or decrease the view. I’ve also set webkitallowfullscreen mozallowfullscreen allowfullscreen to scale the page in order to fit the device screen but nothing changed and the page is still cut.

Here’s my detail-page:

  <iframe sandbox class="link" frameborder="0" [src]="webPage()" zooming="true" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>


detail-page {

        padding: 0px ;

	*::-webkit-scrollbar {
		display: none;

	iframe.link {
		width: 100%;
		height: 100%;
		max-width: 100%;
		max-height: 100%;


webPage() {
    	return this.sanitizer.bypassSecurityTrustResourceUrl(this.entry.getElementsByTagName('link')[0].textContent);

As suggested on the only answer on SO, I had to add document.getElementsByTagName('iframe').contentWindow.document.body.style = 'zoom:50%';, I only got a Typescript error:

Typescript Error
Property 'contentWindow' does not exist on type 'NodeListOf<HTMLIFrameElement>'.

Here’s my whole .ts file:

export class DetailPage {

    entry:any = [];

    constructor(private sanitizer: DomSanitizer, public nav: NavController, navParams:NavParams) {
        this.nav = nav;
        this.entry = navParams.get('selectedEntry');
        console.log('My entry is: "'+ this.entry.getElementsByTagName('title')[0].textContent + '"');
        document.getElementsByTagName('iframe').contentWindow.document.body.style = 'zoom:50%';

    webPage() {
    	return this.sanitizer.bypassSecurityTrustResourceUrl(this.entry.getElementsByTagName('link')[0].textContent);


After adding id="myframe" inside <iframe> I’ve also tried with the function ngAfterViewInit() but still no changes there.

ngAfterViewInit() {
  var x = document.getElementById("myframe");
  var y = (<HTMLIFrameElement> x).contentWindow.document;
  y.body.style.zoom = "50%";

And in this form too:

ngAfterViewInit() {
    var iframe:HTMLIFrameElement = <HTMLIFrameElement>document.getElementById('myframe');
    var iWindow = (<HTMLIFrameElement>iframe).contentWindow.document;
    iWindow.body.style.zoom = "50%";

Hope you can help me.