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

alfred-firefoxtabswitch

v1.1.1

Published

An alfred workflow to quickly switch between tabs on Firefox

Downloads

14

Readme

Alfred Firefox Tab switcher

demo gif

An Alfred workflow to quickly switch between firefox tabs.

Installation

Requirements

1. Install the workflow

You need to install the workflow first as it will also install the native messaging host component of the extension (required before the extension is started).

npm install -g alfred-firefoxtabswitch

The workflow will register automatically with Alfred, and the Native Manifest will be written automatically upon install at /Library/Application Support/Mozilla/NativeMessagingHosts/alfredtabswitch.json

2. Install the Firefox extension

Go to https://addons.mozilla.org/en-US/firefox/addon/alfred-tab-switch/ and install it from there.

Usage

Invoke the workflow with fw (you can customize that in Alfred), all opened tabs (across all windows) will be shown.

If more than one argument is supplied to the workflow, all arguments must be present in either the title or the URL.

Then simply hit ENTER on the tab you want to focus.

Architecture

                                                    ┌───────────┐
                                                    │  Alfred   │
                                                    └───────────┘
                                                          ▲
                        ╭──────────────╮                  │
                        │ ◎ ○ ○ ░░░░░░░│                  │
                        ├──────────────┤            ┌─────┴─────┐
                        │              │            │UDP socket │
                        │              │            └─────┬─────┘
                        │              │                  │
                        │       ┌──────┴─────┐            ▼
                        └───────┤ Extension  ├───────────────────────────┐
                                └──────────┬─┘  Native Messaging Host    │
                                           └─────────────────────────────┘

The firefox extension will automatically spawn the native messaging host at startup.

The host will open an UDP socket on port 52547 and listen for incoming connections.

Alfred interacts with Firefox via the UDP socket, querying for the list of tabs, and commanding to switch to a given tab. These inteactions are handled by the ./host/client.js file (spawned by alfred).

Each time the user issues a command, Alfred will spawn an instance of host/client.js, which will talk to the UDP socket and kill itself when the result is returned.

If the native messaging host fails to reply within 1 second, the client will kill itself.

Why so complex?

Other workflows use Apple Script to switch tabs for Safari, Chrome etc.

But Firefox does not expose its tabs to the system, so the only way is to use an extension with an native messaging component that allows alfred to communicate with firefox.

Debugging

TODO