@ky-is/twitch-extension-channel-manager

0.2.0 • Public • Published

twitch-extension-channel-manager

Allow users to enable and disable your Twitch.tv browser extension on a per-channel basis of their choosing.

Setup

Include images/icon-on.png and images/icon-off.png images in your extension bundle.

Usage

In your manifest file, ensure you have an entry for background and content_scripts:

  "background": {
    "persistent": false,
    "scripts": ["background.js"]
  },
  "content_scripts": [
    {
      "matches": ["*://www.twitch.tv/*", "*://twitch.tv/*"],
      "js": [ "inject.js"]
    }
  ]

In your background script file, add:

import './twitch-extension-channel-manager/background'

In your content script, add:

import { injectTwitchPageOnBehalfOf } from './twitch-extension-channel-manager/inject'

injectTwitchPageOnBehalfOf('YOUR_PROJECT_CSS_CLASSNAME', () => {
  // Run your code here whenever the page content on Twitch updates.
})

Readme

Keywords

none

Package Sidebar

Install

npm i @ky-is/twitch-extension-channel-manager

Weekly Downloads

1

Version

0.2.0

License

ISC

Unpacked Size

6.91 kB

Total Files

6

Last publish

Collaborators

  • kyis