window.open() opens a new electron browser window instead of native browser window - html

My electron desktop app loads an angular app into a browser window. That angular app has a button that should open a new website (lets say google.com as an example). When I use the following code...
<button (click)="openNew()">Open a new window</button>
openNew() {
window.open('www.google.com')
}
the app opens a new electron browser window. I want the window to open in a native browser window (chrome, firefox, internet explorer, etc). Can this be possible within an electron app?

Based on documentation, you can open links on OS default browser with code below
const { shell } = require('electron')
shell.openExternal('https://github.com')
Read for further information:
https://www.electronjs.org/docs/api/shell#shellopenexternalurl-options

Related

How to check the number of open browser windows using Puppeteer?

I have an open browser window where the user clicks a button and after that, a new browser window opens with a new page.
How can I check that there are two browser windows open and not two pages?
The browser.browserContexts() property does not work, because if a new browser window is opened after clicking on another browser window, then these two browser windows have the same context.

Running Chrome in app mode with multiple tabs?

So I have set up an app shortcut for YouTube in Chrome. When I click this, I get a new window that opens to YouTube's website. Works great. However, if I want to for example open videos in a new tab, these will be redirected to my main Chrome window, which is not what I want as I would rather have them as tabs in the YouTube app window.
Is this possible with some flag?

Open Links in App Mode in Chrome Browser

Information:
I'm developing Web App in chrome I can make shortcut in desktop to open my app in App Mode through More tools >> add to desktop.
The problem is when I try to open any Link in new window with hot key Shift. It opens in normal mode full features with address bar and tabs bar.
Question Is:
Is there a way to make the links open in new window with the same App Mode in Chrome ?
Regards,

How can I enable standard zoom controls in a chrome app (extension)?

I would like to be able to zoom in a chrome application (ctrl + scroll, CTRL and +/-, Pinch-zoom). This works when running as a normal webpage but doesn't when running as a chrome app. Is there a way to turn it on?
The Android WebView supports this via code like the following:
webView.getSettings().setSupportZoom(true);
webView.getSettings().setBuiltInZoomControls(true);
webView.getSettings().setDisplayZoomControls(false);
Is there an equivalent for a Chrome App written in JavaScript for ChromeOS?

Chrome app in window

I want to create chrome web app that will open in own window like Google Keep extension for chrome.
I made chrome web store package, but how to open it in self window instead of chrome browser ??
Create a packaged app by
Using a manifest with { 'app': { 'background': '...' } ....
Add a chrome.app.runtime.onLaunched listener that calls chrome.app.window.create
See the hello-world sample.