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

XMLHttpRequest from background page fails after an iframe is removed from window #6410

Closed
sparkyb opened this issue Jan 18, 2018 · 2 comments
Assignees

Comments

@sparkyb
Copy link

sparkyb commented Jan 18, 2018

NWJS Version : 0.27.5
Operating System : Linux (Ubuntu 14.04)

Expected behavior

XMLHttpRequest should work in the background page.

Actual behavior

After an iframe is deleted in a window, the XMLHttpRequest in the background page fails with

How to reproduce

  1. Use a background JavaScript file as the project's main file.
  2. Use nw.Window.open() to open a window
  3. Add an <iframe> to that window's DOM (or have it be part of the initial HTML)
  4. Remove the iframe from the window's DOM.
  5. From the background page, execute an XHR.
  6. Instead of the XHR working, the following exception is raised:

DOMException: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'chrome-extension://bcgokjambocaplmhfjlfkafhjiacmpci/xhrbug.json': Document is already detached.

A sample is attached.

xhrbug.zip

@Christywl
Copy link
Contributor

I can reproduce this issue with the attached sample on Windows and Linux with nwjs-sdk-v0.27.5.

rogerwang added a commit that referenced this issue Jan 19, 2018
The trick was used in pre-0.13 to add XMLHttpRequest in Node to
support content verification. It's not needed any more.

Fix #6410
@rogerwang
Copy link
Member

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

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

No branches or pull requests

3 participants