Rhys Edwards Rhys Edwards - 1 year ago 101
HTML Question

Open Chrome in a new window (Chrome app)

I'm trying to create a chrome app that when i click on a button, it opens a new chrome window, at the moment it just opens a new tab.


<script src="jquery-3.1.1.min.js"></script>
<script src="script.js"></script>





$(document).ready(function() {
$("button").click(function() {

Xan Xan
Answer Source

Sadly, there's no way to do that that I know of.

Using window.open in an app's context is a bit of a hack, but results in the URL being open in the user's default browser (not necessarily Chrome). There's no control as to how the browser chooses to open it.

There's a Chrome App specific API that was created specifically with "open a page in Chrome" in mind, chrome.browser. However, it still doesn't provide an option to open in a new window.

The closest you can get is to create your own "browser": an app window with a <webview> in it. Then you have full control over presentation, but it's not integrated with Chrome's profile and may require additional work to implement things like dialogs and browser controls. See the Browser sample app and <webview> documentation.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download