0

I have an extjs iframe created as below which gets rendered onto a page when called using its xtype. However, the page displays "cannot connect to" the URL I specified in src parameter error message. But if I access the URL which I have in src parameter directly from the browser, I am able to access it. What is the issue here? Any suggestions would really help!

Ext.define('myComp', {
extend:'Ext.container.Container',
xtype: 'iframe'

itemId:'iframe204'
requires: [
  'Ext.ux.IFrame',
],


layout:'fit',
height:'100%',

initComponent:
    function() {
        this.items = [];
        this.items.push({
           xtype:'uxiframe',
           itemId:'myframe',
           height:'100%',
           src: someURL
});

this.callParent(arguments);
  },
});
Ash
  • 63
  • 5
  • 1
    Most probable the URL that you are requesting has blocked its display in an iframe. – Arthur Jul 06 '22 at 09:51
  • @Arthur, are you referring to "x-frame options" seen in networks tab? if so, is it possible to override that in some way to make it display? – Ash Jul 06 '22 at 15:31
  • 1
    There is a plugin for Chrome, that might helps. (use this as temporary fix) **https://chrome.google.com/webstore/detail/ignore-x-frame-headers/gleekbfjekiniecknbkamfmkohkpodhe/related** Refer this link as well: **https://stackoverflow.com/questions/6666423/overcoming-display-forbidden-by-x-frame-options** – shae Jul 06 '22 at 18:08
  • @shameei the plugin fixed the issue, and I see a lot of different ways to fix this from the server side. I was wondering if you are aware of any way in extjs to override or ignore the x-frame headers or perhaps any client side workaround for this? – Ash Jul 06 '22 at 22:49
  • 1
    I wish to help you more but this is new to me as well. I believe this is related to Content-Security-Policy and it is due to the settings on the server that hosts the page you're attempting to embed in the iframe. This setting forbids embedding that page in an iframe on another website. There's nothing you can do about this error, unless you can control the server which is serving that embedded URL. You can find out more about X-Frame-Options here: **https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options.** – shae Jul 07 '22 at 13:07

0 Answers0