open-in-chrome
v0.0.2
Published
Open a URL in Chrome or switch to the existing tab if it's already opened
Downloads
2
Maintainers
Readme
open-in-chrome
Open a URL in Chrome or, on macOS, switch to the existing tab if it's already opened
Installation
npm install open-in-chrome
API
const openInChrome = require('open-in-chrome');
openInChrome(url [, options])
url: string
or URL
options: Object
Return: Object
It only supports macOS, Linux and Windows.
On macOS, it runs a JXA script which launches Chrome and open a URL in a new tab
On Linux, it opens a URL with google-chrome
command in a new tab.
On Windows, it opens a URL with start C:\path\to\chrome.exe
command in a new tab.
options
Type: Object
All execa
options are available
License
ISC License © 2018 Shinnosuke Watanabe