I have a node which will start a loop on incoming msg.payload="start"
But before actually starting I'd like a popup to appear asking whether the user is sure.
I've tried "confirm" but that apparently doesn't work as the javascript code runs in node-js. Not in the browser.
Flows run in the node.js runtime, entirely independently of whether someone has the editor open in a browser window. The editor is not meant to be a user dashboard for the flows.
If you are trying to create a node that has this confirmation step built into it, that anyone could install and use - you cannot rely on what UI that user has available to them to act on the confirmation.
If you are trying to build a confirmation step into a set of flows you are running, then you can look at things like Node-RED Dashboard to create a user interface for your flows - which is where the notification node Colin mentions would come in.