question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

website not openning in iframe

See original GitHub issue

NWJS Version : 0.54.1 Operating System : macOS Catilina

Expected behavior

should open website with cors in iframe on nwjs app

Actual behavior

not opening website with cors in iframe, throwing error:

Refused to frame ‘https://github.com/’ because an ancestor violates the following Content Security Policy directive: “frame-ancestors ‘none’”.

How to reproduce

Just running a simple application with iframe in it, it is not opening iframe and throwing error:

Refused to frame ‘https://github.com/’ because an ancestor violates the following Content Security Policy directive: “frame-ancestors ‘none’”.

I also have added nwfaketop and node-remote in manifest.json but nothing work:

<html>
    <head>
        <title>
            test nw
        </title>
    </head>
    <body>
        <div>iframe: </div>
        <iframe src="https://github.com/" style="width: 100%;height: 100%;" nwfaketop></iframe>
    </body>
</html> 
{
  "name": "nw-test",
  "version": "1.0.0",
  "description": "",
  "main": "index.html",
  "node-remote": "https://www.github.com/",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC"
}

sample project zip is also attached: nw-test.zip

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
rogerwangcommented, May 6, 2022

This is fixed in git and will be available in the next nightly build.

1reaction
FahadQurashi49commented, Nov 10, 2021

Have you tried Node Frame using node-remote field.

What can Node frames do? 3. Ignore X-Frame-Options headers for child frames.

Source: https://github.com/nwjs/nw.js/wiki/Security

Aka “remote sites when URL matches the node-remote field”

yes I’ve used “node-remote” field in above example, see my package.json

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't show some websites in iframe tag
You have to check for HTTP response header X-Frame-Option of those sites. if its value is "DENY or SAMEORIGIN", then you can not...
Read more >
4 Ways to Fix iFrame When it's Not Working in Chrome
What can I do if iFrame doesn't work in Chrome? · 1. Disable/enable iFrames from Internet Options · 2. Stop your antivirus service...
Read more >
Iframe not loading in HTML
The site you're trying to load has either set the X-Frame-Options[^] header, or has sent a content security policy (CSP) with the frame- ......
Read more >
WEB PAGE in IFRAME not working
I am a MDB PRO user I just want to use Iframe to show my other website product pages on my website in...
Read more >
Why can't I embed my page as an iFrame?
Websites that begin with http cannot be embedded as iFrames. This is because they are not secure. HTTPS. Websites that begin with https...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found