Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yoihito/chrome-active-tab
https://github.com/yoihito/chrome-active-tab
Last synced: 20 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/yoihito/chrome-active-tab
- Owner: yoihito
- License: mit
- Created: 2019-05-23T11:17:40.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-07-12T14:28:23.000Z (over 5 years ago)
- Last Synced: 2024-10-12T09:11:48.112Z (about 1 month ago)
- Language: Swift
- Size: 10.7 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# chrome-active-tab [![License](https://img.shields.io/npm/l/chrome-active-tab.svg)](https://github.com/yoihito/chrome-active-tab/blob/master/LICENSE)
Get metadata about the active tab in Chrome(title, url).Works on macOS.
## Install
```
$ npm install chrome-active-tab
```## Usage
```js
const chromeActiveTab = require('chrome-active-tab');(async () => {
console.log(await chromeActiveTab());
/*
{
title: 'chrome-active-tab - npm',
url: 'https://www.npmjs.com/package/chrome-active-tab',
platform: 'macos'
}
*/
})();
```## API
### chromeActiveTab()
Returns a `Promise` with the result, or `Promise` if there is no active tab or if the information is not available.
### chromeActiveTab.sync()
Returns an `Object` with the result, or `undefined` if there is no active tab.
## Result
- `title` *(string)* - Tab title
- `url` *(string)* - Tab url
- `platform` *(string)* - Platform## OS support
It works on macOS.
## License
MIT