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

Window context in >= NW.js 0.13 #9

Open
vzamanillo opened this issue Jun 20, 2016 · 0 comments
Open

Window context in >= NW.js 0.13 #9

vzamanillo opened this issue Jun 20, 2016 · 0 comments
Assignees
Labels
Milestone

Comments

@vzamanillo
Copy link

vzamanillo commented Jun 20, 2016

With the new NW.js the dialog is never opened, now it is mandatory to specify the NW.js window object as option because the DOM window of node context is on a separate context and the browser context is not accesible.

So you can not use the exported module functions

fdialogs.readFile(function (err, content, path) {
});

fdialogs.saveFile(buff, function (err, path) {
});

You must use the exported FDialog in this way:

For save dialog:

var saveDialog = new fdialogs.FDialog({
    type: 'save',
    window: nw.Window.get().window
});
saveDialog.saveFile(buff, function (err, path) {
});

For open dialog:

var openDialog = new fdialogs.FDialog({
    type: 'open',
    window: nw.Window.get().window
});
openDialog.readFile(function (err, content, path) {
});

NW.js Separate context node

@exos exos added the wontfix label Jun 27, 2016
@exos exos added this to the 0.6.0 milestone Jun 27, 2016
@exos exos self-assigned this Jun 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants