-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
nwjs 0.13 beta2 - sockets.tcp.connect: Does not have permission #4143
Comments
Currently NW doesn't support setting permissions for Chrome APIs within NW app. We will consider this feature in future releases. |
@cTn-dev if it is a NW app, it's supposed to be able to run chrome.* APIs by default. Could you please upload a sample where you "can't open/connect through the chrome.sockets api" ? We'll fix it soon. |
@ghostoy the problem is not NW lacking permissions field in manifest. NW app should be able to use all chrome.* APIs by default. |
Hi guys, here is a very simple demo code https://dl.dropboxusercontent.com/u/31740/storage/demo_4143.zip All the fun stuff is in the console, if you load the demo directory as is, it will load as NW app and give you an permission error for the chrome.sockets.tcp.connect. To run in it as chrome app simply delete the package.json and load the app again, in this case the app will have the required permissions and it will connect to the irc server. |
This is fixed in git and will be available in the next nightly build. NW uses the following way to tell NW app from Chrome app: when there is package.json, it's a NW app, otherwise if there is manifest.json, it's a Chrome app. NW app has all the permissions to use chrome.* API. Will add this to doc. |
Sorry for asking a stupid question, but does that mean the chrome.sockets api will now be usable in the NW app, and it was simply missing from the permissions list? Thank you guys for all the hard work you put into NW |
@cTn-dev I think the first comment confuses you. Permission list is not needed in NW app to use chrome.* APIs. What you've reported is a bug and fixed in the last nightly: http://dl.nwjs.io/live-build/01-05-2016/ |
Thanks @rogerwang just tested the latest nightly build, the socket api works just the way it should! |
Hi guys, i have a weird problem when it comes to using the chrome.sockets.tcp.connect
If i simply load my chrome app (not providing package.json) chrome.sockets works, but in this state i can't really embed external javascript due to the security policy (i need to use the "https://www.youtube.com/iframe_api").
If i provide a package.json (which will make the app behave more like nwjs app) embedding external javascript works just fine, but i can't open/connect through the chrome.sockets api.
Is there any workaround that i could use to resolve this?
If you need some more detailed error messages from the console, let me know, ill paste them in.
Thank you.
The text was updated successfully, but these errors were encountered: