# chromex

> Some helpful functions for working with chrome extensions

Latest version **1.2.2** (published 2015-11-10) · ISC license · 0 weekly downloads

## Install

```sh
npm install chromex
pnpm add chromex
yarn add chromex
bun add chromex
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.2 |
| Published | 2015-11-10 |
| First published | 2015-01-14 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Damon Oehlman |
| Maintainers | damonoehlman |
| Keywords | chrome, extension |

## Links

- npm: https://www.npmjs.com/package/chromex
- Repository: https://github.com/DamonOehlman/chromex
- Issues: https://github.com/DamonOehlman/chromex/issues
- npm.io page: https://npm.io/package/chromex

## Dependencies (5)

- [cog](https://npm.io/package/cog.md) ^1.0.0
- [kgo](https://npm.io/package/kgo.md) ^3.1.2
- [cuid](https://npm.io/package/cuid.md) ^1.2.4
- [slimver](https://npm.io/package/slimver.md) ^1.0.0
- [eventemitter3](https://npm.io/package/eventemitter3.md) ^0.1.6

## Recent versions

- 1.2.2 (latest) — 2015-11-10
- 1.2.1 — 2015-11-08
- 1.2.0 — 2015-08-30
- 1.1.0 — 2015-03-27
- 1.0.5 — 2015-03-27
- 1.0.4 — 2015-03-25
- 1.0.3 — 2015-03-25
- 1.0.2 — 2015-02-23
- 1.0.1 — 2015-02-23
- 1.0.0 — 2015-01-14

## README

# chromex

This is a set of helpers for working with chrome extensions.


[![NPM](https://nodei.co/npm/chromex.png)](https://nodei.co/npm/chromex/)

[![bitHound Score](https://www.bithound.io/github/DamonOehlman/chromex/badges/score.svg)](https://www.bithound.io/github/DamonOehlman/chromex) 

## Example Usage

To run the example that is included in this repo, first install
browserify and beefy:

```
npm install -g browserify beefy
```

Then run `npm start` to run the example.

__NOTE:__  Because the example is attempting to use inline installation
to install the rtc.io screensharing extension (as an example) you will
need to set a host entry for `local.rtc.io` to point to `localhost`. This
is because inline installation is only allowed for specific domains on
any particular extension.

Once you have everything setup goto <http://local.rtc.io:9966> and take
the example for a spin. If you are interested in the code, it's shown
below:

JS:

```js
var h = require('hyperscript');
var extension = require('chromex/client')({
  target: 'rtc.io screenshare'
});

var installButton = h('button', 'Install Extension', { onclick: function() {
  chrome.webstore.install();
}});

function informReady() {
  document.body.appendChild(h('div', 'ready to go!'));
}

// detect whether the extension is installed
extension.installed(function(err) {
  var actions = document.getElementById('actions');

  if (err) {
    return actions.appendChild(installButton);
  }
});

// on install show the capture button and remove the install button if active
extension.on('activate', function() {
  if (installButton.parentNode) {
    installButton.parentNode.removeChild(installButton);
  }

  informReady();
});

```

HTML:

```html
<html>
<head>
<title>Chromex Example Page</title>
<link rel="chrome-webstore-item" href="https://chrome.google.com/webstore/detail/einjngigaajacmojcohefgmnhhdnllic">
</head>
<body>
<div id="main"></div>
<div id="actions"></div>
<script src="bundle.js"></script>
</body>
</html>

```

## License(s)

### ISC

Copyright (c) 2015, Damon Oehlman <damon.oehlman@gmail.com>

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.

---
_Source: https://npm.io/package/chromex · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
