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

electron-app-universal-protocol-client

v1.3.0

Published

Unified cross-platform protocol handler for Electron apps, supporting development environments.

Downloads

4,722

Readme

About

Unified and simplified API for Electron application's protocol handlers ("deep links").

Features:

  • support for all platforms (Windows, macOS nad Linux)
  • development mode
  • capturing start-up request (if application was not running and protocol request caused it to be started)

electron-deeplink

This package is based on electron-deeplink.

Differences:

  • switch to yarn
  • support for prebuilds (via prebuildify and GitHub Actions)
  • types support for on('request')
  • no need to call the API as early as possible to catch the first request (just require it)
  • no need to create a new instance of class to use the API
  • removed a lot of default behavior (like focusing the window after protocol request)
  • removed logging support
  • minor fixes

Further changes are listed in CHANGELOG.md.

Huge thanks for @glawson for creating electron-deeplink and allowing me to continue his work as recommended fork.

Installation

# If you use npm:
npm install electron-app-universal-protocol-client

# If you use yarn:
$ yarn add electron-app-universal-protocol-client

Usage

API

electronAppUniversalProtocolClient.on('request', requestHandler)

Register handler for protocol requests in your application.

electronAppUniversalProtocolClient.on(
  'request',
  async (requestUrl) => {
    // Handle the request
  },
);

electronAppUniversalProtocolClient.initialize({ protocol: string; mode?: 'development' | 'production' })

Initialize the client.

mode is 'production' by default.

Remember to register protocol handlers before calling initialize, otherwise you might loose some requests.

await electronAppUniversalProtocolClient.initialize({
  protocol: 'your-app-id',
  mode: 'development', // Make sure to use 'production' when script is executed in bundled app
});

Example

Please note that example directory contains fake node_modules that allows the example to be started within this repository.

Development mode

Make sure you're launching Electron with your main script path as first argument. Development mode is implemented upon this assumption.

macOS Development Mode Permissions Issue

Due to macOS permissions system, you could experience following errors after starting your Electron app in development mode:

[42590:1203/200159.650790:ERROR:mach_port_rendezvous.cc(310)] bootstrap_look_up com.github.my-app-id.MachPortRendezvousServer.42588: Permission denied (1100)
[42590:1203/200159.651421:ERROR:child_thread_impl.cc(228)] Mach rendezvous failed, terminating process (parent died?)

To fix them, run this command in project's root directory:

sudo xattr -r -d com.apple.quarantine ./