https://github.com/react-doc/open-browsers
Attempts to open the browser with a given URL. On Mac OS X, attempts to reuse an existing Chrome tab via AppleScript.
https://github.com/react-doc/open-browsers
applescript browsers npm openbrowser
Last synced: 4 months ago
JSON representation
Attempts to open the browser with a given URL. On Mac OS X, attempts to reuse an existing Chrome tab via AppleScript.
- Host: GitHub
- URL: https://github.com/react-doc/open-browsers
- Owner: react-doc
- License: mit
- Created: 2018-06-07T05:07:29.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2025-05-07T05:51:19.000Z (5 months ago)
- Last Synced: 2025-05-29T18:33:21.023Z (4 months ago)
- Topics: applescript, browsers, npm, openbrowser
- Language: JavaScript
- Size: 42 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
Open Browsers
===[](https://jaywcjlove.github.io/#/sponsor)
[](https://github.com/react-doc/open-browsers/actions/workflows/ci.yml)
[](https://www.npmjs.com/package/open-browsers)
[](https://www.npmjs.com/package/open-browsers)Attempts to open the browser with a given URL.
On Mac OS X, attempts to reuse an existing Chrome tab via AppleScript.
Otherwise, falls back to [open](https://github.com/sindresorhus/open) behavior. `open-browsers` form [react-dev-utils](https://github.com/facebook/create-react-app/blob/b8ff97be72c02128c0917437d98e1b672a25ceb4/packages/react-dev-utils/openBrowser.js).### Install
```bash
npm install open-browsers --save-dev
```### Usage
> openBrowsers(url: string): boolean
```js
var openBrowsers = require('open-browsers');
if (openBrowsers('http://localhost:3000')) {
console.log('The browser tab has been opened!');
}
```## Contributors
As always, thanks to our amazing contributors!
Made with [contributors](https://github.com/jaywcjlove/github-action-contributors).
### License
`open-browsers` is open source software licensed as MIT.