Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disable web security doesn't work #6894

Closed
smurfiez opened this issue Dec 10, 2018 · 5 comments
Closed

disable web security doesn't work #6894

smurfiez opened this issue Dec 10, 2018 · 5 comments
Assignees

Comments

@smurfiez
Copy link

NWJS Version : 0.34.5-sdk
Operating System : Windows

Expected behavior

I'm trying to access a google account via an iframe, using disable web security I'm expecting that I should be able to view at least the document location.

Actual behavior

main.html:33 Uncaught DOMException: Blocked a frame with origin "chrome-extension://pnmfgloclchaammoaigmkelpmkfdkkfi" from accessing a cross-origin frame.
    at onLoad (chrome-extension://pnmfgloclchaammoaigmkelpmkfdkkfi/main.html:33:36)
    at HTMLIFrameElement.onload (chrome-extension://pnmfgloclchaammoaigmkelpmkfdkkfi/main.html:26:84)

I'm getting this error

How to reproduce

<!DOCTYPE html>
<html>
<head>
<title>Zoek and Kopen 2</title>

  <style>

    html {
      height: 100%;
    }

    body {
      height: 92%;
    }

    iframe {
      width: 100%;
      height: 90%;
      box-sizing: border-box;
    }  
  </style>
</head>
<body>


  <iframe src="https://contacts.google.com/" nwdisable nwfaketop onload="onLoad()"></iframe>

  </iframe>

</body>
<script>
  function onLoad() {
      console.log(window.frames[0].document.location);
  }
</script>
</html>

nwjs is launched with --user-data-dir="" --disable-web-security

@rogerwang rogerwang self-assigned this Dec 11, 2018
@rogerwang
Copy link
Member

rogerwang commented Dec 11, 2018

This case is google URL specific. It tries to create the site in separate process then the access is failed.

@smurfiez
Copy link
Author

Is there any workaround for this?

@rogerwang
Copy link
Member

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

@rogerwang
Copy link
Member

btw, the switch disable-web-security is not relevant to the issue. It's not needed for the fix to be effective.

@rogerwang
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants