I have made a thing in NW.js. By default, any hyperlinks that the user can click on opens in a new NW.js browser window.
I'm trying to make it so that some (not all or none!) of these open in the system browser instead. It is important that these are <a> elements; not JavaScript function calls.
Reading on this page: https://nwjs.readthedocs.io/en/latest/References/Window/#event-new-win-policy-frame-url-policy
... I was able make it so that all hyperlinks open in the system browser. But I only want this for some. I want to specify an attribute or something, such as <a some-attribute="open-in-system-browser"...> which can be checked in the code:
nw.Window.get().on('new-win-policy', function(frame, url, policy)
{
policy.ignore();
nw.Shell.openExternal(url);
});
What am I missing? If it can be avoided, I don't want to "parse the url" to determine this, as it's ugly and messy. Both "frame" and "policy" seem like useless parameters.