How open link with hash (#) in new window


I want open link in new window. Link with hash (#). After hash going page for my JS framework.
I do:

const modalPath = path.join('file://', __dirname, 'index.html#','message',chat_id,'child-window');
let win = new BrowserWindow({width: 400, height: 200, show: false, frame: false});

It is worked for mac, but not work for Windows (open only index.html- mainpage)


Using path.join to build a URL is not a good idea since the path separators will differ between platforms, on Windows you’ll end up with something like file://\dirname\index.html#\message\chat_id\child-window, whereas on Mac/Linux you’ll get file://dirname/index.html#/message/chat_id/child-window. What you should do instead is ```url.format({ protocol: ‘file’, pathname: ${__dirname}/index.html#/message/${chat_id}/child-window })``.