Mohammad Asif cf937194cb Removed un-waned things 1. | 5 miesięcy temu | |
---|---|---|
.. | ||
dist | 5 miesięcy temu | |
LICENSE | 5 miesięcy temu | |
README.md | 5 miesięcy temu | |
openChrome.applescript | 5 miesięcy temu | |
package.json | 5 miesięcy temu | |
yarn.lock | 5 miesięcy temu |
A better opn. Reuse the same tab on Chrome for 👨💻. Inspire by create-react-app
$ yarn add better-opn
$ npm install better-opn
If you wish to overwrite the default browser, override BROWSER
environment variable to your desired browser name (name is platform dependent).
const opn = require('better-opn');
opn('http://localhost:3000');
In case your app can navigate to another pathnames and still want to reuse opened tab, set environment variable OPEN_MATCH_HOST_ONLY=true
can tell this program to find reusable tab by only match the host part of your URL.
process.env.OPEN_MATCH_HOST_ONLY = 'true';
opn('http://localhost:3000/foo/bar'); // This will reuse any tab with URL starting with http://localhost:3000/