拒绝在框架中显示网站,因为它在Ionic中将'X-Frame-Options'设置为'deny'?

时间:2018-05-18 07:23:56

标签: ionic-framework iframe cors ionic3 x-frame-options

我正在尝试使用iframe加载此https://www.shopify.in/website网站,但它给出了以下错误:

  

拒绝在框架中显示“url”,因为它设置了“X-Frame-Options”   'DENY'

在html中:

<iframe class='webPage' name="samplePage" [src]="myURL"></iframe>

在ts:

export class HomePage {
  myURL: any;
  constructor(public navCtrl: NavController, private sanitizer: DomSanitizer) {

  }

  initialize = () => {
    this.myURL = this.sanitizer.bypassSecurityTrustResourceUrl('https://www.shopify.in/website');

  };

  ionViewDidLoad() {
    this.initialize();
  }

}

然后我尝试了jquery。错误消失了,但网站也没有加载。

in html:

<div id="loadExternalURL" style="width: 100%; height: 100%"></div>

在ts:

export class HomePage {
  constructor(public navCtrl: NavController) {

  }

  initialize = () => {
    $('#loadExternalURL').load('https://www.shopify.in/website');
  };

  ionViewDidLoad() {
    this.initialize();
  }

}

如何在iframe中加载此网站?

0 个答案:

没有答案