🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

br-chrome-tabs

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

br-chrome-tabs

Browserify compatible HTML/CSS and JS chrome tabs implementation

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

chrome-tabs Dependency Status

Browserify compatible chrome-tabs by Adam Schwartz.

Demo

Requirements

  • jQuery
  • brfs transform to inline HTML and CSS resources when browserified:
$ browserify -t brfs chrome-tabs.js > bundle.js

Usage

var chromeTabs = require("br-chrome-tabs")

// Add chrome tabs CSS to page head
chromeTabs.insertCss()

// Init chrome tabs in the container .chrome-tabs-shell
var $chromeTabsExampleShell = $(".chrome-tabs-shell")

chromeTabs.init({
  $shell: $chromeTabsExampleShell,
  minWidth: 45,
  maxWidth: 180
})

// Add a new tab
chromeTabs.addNewTab($chromeTabsExampleShell, {
  favicon: "http://g.etfv.co/https://www.hubspot.com",
  title: "HubSpot",
  data: {
    timeAdded: +new Date()
  }
})

// Log tab change data to console
$chromeTabsExampleShell.bind("chromeTabRender", function (){
  var $currentTab = $chromeTabsExampleShell.find(".chrome-tab-current")
  if ($currentTab.length && window["console"] && console.log) {
    console.log("Current tab index", $currentTab.index(), "title", $.trim($currentTab.text()), "data", $currentTab.data("tabData").data)
  }
})

Keywords

chrome

FAQs

Package last updated on 21 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts