How to open the url in the new window of default browser

I have a macOS application.

I need to open an url (e.g. https://www.google.com) in the new window of default browser. I tried to use the openURL method of NSWorkspace class. It opens the url in the new tab in default browser, but I did not find a way to open the url in new window.

Also, I tried to use NSAppleScript's executeAndReturnError method with following script:

tell application "Safari" \n
activate \n
set d to make new document \n
set URL of d to "https://www.google.com" \n
end tell

It opens the url in the new window of Safari. I cannot use it for opening the url in default browser.

I wanted to know if there is a way to open the url in the new window of default browser.

How to open the url in the new window of default browser
 
 
Q