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

[NW2] new-win-policy doesn't work #7451

Closed
Docteh opened this issue Apr 24, 2020 · 1 comment
Closed

[NW2] new-win-policy doesn't work #7451

Docteh opened this issue Apr 24, 2020 · 1 comment

Comments

@Docteh
Copy link

Docteh commented Apr 24, 2020

NWJS Version : 0.45.4
Operating System : win64

Expected behavior

Links that request to be opened in a new window will open a browser

Actual behavior

White window, with nothing in it. Works fine if I disable NW2, so #7230 gets a mention

How to reproduce

http://docs.nwjs.io/en/latest/References/Window/#event-new-win-policy-frame-url-policy

I run the following code in the console, and get an Uncaught Error: No current window

nw.Window.get().on('new-win-policy', function(frame, url, policy) {
  // do not open the window
  policy.ignore();
  // and open it in external browser
  nw.Shell.openExternal(url);
});
@Docteh
Copy link
Author

Docteh commented Apr 26, 2020

Hi, sorry for the spurious issue. I had forgotten that the app I was working on silently destroys the main window, and creates a replacement on startup, as part of extension compatibility.

@Docteh Docteh closed this as completed Apr 26, 2020
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

1 participant