Viktor Sidochenko
Viktor Sidochenko

Reputation: 361

How to open link from packaged`s app web-view into default browser?

There is a messenger chrome packaged app with webView inside. How I can open links from messenger in browser?

Project is open source: https://github.com/clicman/OdSkype

Upvotes: 2

Views: 1126

Answers (1)

Xan
Xan

Reputation: 77523

If url is the URL you want to open in a browser from a Chrome App, you have 2 possibilities:

  1. Opening the URL in the user's default browser:

    window.open(url);
    
  2. Opening the URL in Chrome specifically, regardless of the default browser setting, there's a recent API:

    chrome.browser.openTab({url: url});
    

    This requires "browser" permission.

Upvotes: 2

Related Questions