1

Am trying to load https://developers.redhat.com/ in a iframe it works in normal html when i try to open in Chrome but not in firefox. In firefox getting error as "Load denied by X-Frame-Options"

<iframe width="100%" height="600px" frameborder="0" src="https://developers.redhat.com/?interframe=true"
 id="frame2" name="frame1"></iframe>

but when i try to achieve same in VSCode with 'vscode.previewHtml' it won't work. Which browser engine VSCode uses internally? . VSCode example :

provideTextDocumentContent(uri: vscode.Uri): string {
    return `
     <html>
      <head>
      </head>
      <body style="margin: 0; padding: 0; height: 100%;">
       <iframe width="100%" height="600px" frameborder="0" 
        src="https://developers.redhat.com/?interframe=true"
        id="frame2" name="frame1"></iframe>
      </body>
     </html>`
}

though 'vscode.previewHtml' and normal iframe in HTML work fine for a portal which i hosted. Any help or suggestion?

invinciblejai
  • 1,103
  • 1
  • 8
  • 15
  • Under the hood chrome + V8 is used in Electron (which is what vscode is built on). However, for sanity and security reasons the returned HTML code from your previewHTML extension is processed and it could well be that `iframe`s are not allowed there. You can check the source code of vscode if you want to understand what's going on. – Mike Lischke Sep 22 '17 at 06:41
  • @MikeLischke thanks for input i realised that later, now am trying to open it in browser itself from vscode extension but what am looking for is to open a browser within IDE itself. Details can be found here https://stackoverflow.com/questions/46356759/how-to-open-a-browser-within-vscode-just-like-another-editor-tab . can any thing be done here? – invinciblejai Sep 22 '17 at 06:51
  • I haven't tried myself, so I'm not 100% sure, but I really doubt that is possible. If you cannot embed an iframe, how much less likely is it to embed a full HTML page? Maybe reach out to Matt Bierner who's (one of?) the author of previewHTML. He might know for sure (and he's active on SO as well). – Mike Lischke Sep 22 '17 at 06:55
  • got it even i had similar thought , thanks for help i'll try to check with Matt if there is a way – invinciblejai Sep 22 '17 at 06:58

0 Answers0