npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ff-devtools-libs

v0.1.6

Published

This is an experimental repo whose sole purpose is to allow developing Firefox Developer Tools code in a normal HTML context. It originated from the [devtools.html](https://github.com/joewalker/devtools.html) experiment.

Downloads

31

Readme

ff-devtools-libs

This is an experimental repo whose sole purpose is to allow developing Firefox Developer Tools code in a normal HTML context. It originated from the devtools.html experiment.

The most important piece is a WebSocket transport that allows the page to connect to a remote Firefox debugger instance. This lets a normal HTML page access a real live debugging environment.

A lot of other dependencies are provided as well. If you develop against this, your code should run without changes just fine in the Firefox DevTools context as well.

Install it via npm:

npm install ff-devtools-libs

Connecting a remote is as easy as (see below for aliasing devtools to ff-devtools-libs):

const { DebuggerClient } = require('devtools/shared/client/main');
const { DebuggerTransport } = require('devtools/transport/transport');
const { TargetFactory } = require("ff-devtools-lib/client/framework/target");
const socket = new WebSocket("ws://localhost:9000");
const transport = new DebuggerTransport(socket);
const client = new DebuggerClient(transport);

And then you can make whatever API calls you need:

yield client.connect();
const response = yield client.listTabs();
const tab = response.tabs[response.selected];
const options = { form: tab, client, chrome: false };
const target = yield TargetFactory.forRemoteTab(options);

target.activeTab.attachThread({}, (res, threadClient) => {
  threadClient.resume();
});

You will need to create aliases for the top-level devtools and sdk paths. Example webpack config:

{
  resolve: {
    alias: {
      "devtools": "ff-devtools-libs",
      "sdk": "ff-devtools-libs/sdk"
    }
  }
}

Lastly, you need to run a separate proxy for this to work. This sets up a websocket connection that forwards everything to the native devtools TCP connection.

firefox-proxy [--web-socket-port 9000] [--tcp-port 6080]

firefox-proxy is installed with this module, and it exists at node_modules/.bin/firefox-proxy. It is recommend to run it in whatever run task you have in your npm scripts or gulpfile. It's a simple JS file in the bin directory, so you may run node node_modules/ff-devtools-libs/bin/firefox-proxy as well.