@antitoxic/mac-openchrometab

1.0.0 • Public • Published

@antitoxic/mac-openchrometab

  • npm package which offers a single function called openChromeTab
  • openChromeTab opens a URL in Google Chrome (or other Chromium alternative), reusing tab if present
  • if tab is not opened already, it will attempt to load the URL in a tab which is blank (about:blank) or create a new tab
  • if Google Chrome is not running, it will start it
  • if Google Chrome window is unfocused or minimized, it will respectively focus & un-minimize

To make work, this package uses a JXA script written in TypeScript. Even though JXA is outdated and unsupported JavaScript, the TypeScript offers more familiar development environment than the usual AppleScript used for automating mac.

Usage

import { openChromeTab } from '@antitoxic/mac-openchrometab';
//...
openChromeTab('http://localhost:8080');

Use cases

  • During active web development, you can automatically open or reuse already opened tab
  • Writing scripts to focus on specific tab you know the url of.

Readme

Keywords

none

Package Sidebar

Install

npm i @antitoxic/mac-openchrometab

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

5.48 kB

Total Files

7

Last publish

Collaborators

  • antitoxic