segmentio / chrome-sidebar

Easiest way to embed an iframe as a chrome extension

Home Page:https://open.segment.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

chrome-sidebar

Easiest way to embed an iframe as a chrome extension
built by Segment

Demo

Chrome sidebar demo

Features

  • 6kb! minified
  • Completely customizable CSS that won't conflict with page styles
  • Mount any iframe or React component

Installation

yarn add chrome-sidebar
# or
npm install --save chrome-sidebar

Example

import React from 'react'
import ReactDOM from 'react-dom'
import { Frame } from 'chrome-sidebar'
import { url } from './settings'

if (Frame.isReady()) {
  Frame.toggle()
} else {
  boot()
}

function boot() {
  const root = document.createElement('div')
  document.body.appendChild(root)

  const App = (
    <Frame url={url} />
  )

  ReactDOM.render(App, root)
}

Getting Started

Download an example or clone the repo:

curl https://codeload.github.com/segmentio/chrome-sidebar/tar.gz/master | tar -xz --strip=2 chrome-sidebar-master/examples/github-trending
cd github-trending

Install it and run:

npm install
npm run dev

For development, you need to load it as an unpacked extension:

How to load unpacked extension

Now, you should have a chrome sidebar extension on all of your pages!

Production

In order to share your extension with others, publish to the Chrome Web Store. You can keep the extension unlisted (no one can search for it) or private (people have to be added to a Google group to see it).

Learn more about Chrome's manifest.json

License (MIT)

WWWWWW||WWWWWW
 W W W||W W W
      ||
    ( OO )__________
     /  |           \
    /o o|    MIT     \
    \___/||_||__||_|| *
         || ||  || ||
        _||_|| _||_||
       (__|__|(__|__|

Copyright (c) 2017-present Segment.io, Inc. open@segment.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Easiest way to embed an iframe as a chrome extension

https://open.segment.com


Languages

Language:JavaScript 100.0%