Closed JohnLego closed 2 years ago
Since alert() is from chromium, I don't think you can. Also alert() almost was removed a few months ago, and it might be again. I'd recommend just using a js dialog like sweet alert or something to make it more future proof.
Thanks. Also, alert() is still working from menu items and web pages in nw.js so, I do not know what are you talking about.
Thanks. Also, alert() is still working from menu items and web pages in nw.js so, I do not know what are you talking about.
As @bluthen explained, this is not an NW.js bug (or even a bug at all). This is a security "feature" of Chromium, which NW.js is built on. This is not something that can/should be changed and the issue should be closed.
alert() is still working from menu items and web pages in nw.js so, I do not know what are you talking about.
https://developer.chrome.com/blog/deps-rems-91/
There was an attempt to remove alert for cross-origin iframes and I suspect a want to remove it in all cases. It got reverted but I don't know if this is the end of it. Maybe I should have just left this detail out because who knows what happens in the future.
I'd still recommend using sweetalert or something instead. alert might work when you first start your project but when you want to add more features or customize it, you run into a wall because it is very limited and has side effects. You are usually better off doing something else from the beginning. Maybe just some unsolicited advice based on past experience. You are the one working on your project so do what you want.
@JohnLego
As mentioned by others, this is a feature of Chromium, and not related to NW.js. Alternatively, you can use new Notification()
which is supported in NW.js, Chromium, Firefox, etc. It's sort of a desktop notification, but built in to the browser:
And if you'd like to use an actual desktop notification supplied by the OS, there is a node module that handles this for you:
Closing this issue.
Hello, I would like to set an alert dialog with a title.
NWJS Version : 0.57.1 Operating System : Windows 10
Expected behavior
I want to have the ability to set title in alert (not as css/js import plugin).
Actual behavior
I can only set text if I use alert() or global.alert()