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

chrome-coordinated-capture

v1.0.1

Published

An extension for Google Chrome that allows page scripts to coordinate a recording of what is happening in a tab and to download the resulting video file

Downloads

2

Readme

Coordinated Capture

An extension for Google Chrome that allows page scripts to coordinate a recording of what is happening in a tab and to download the resulting video file. Comes with an API script to simplify communication.

Use case

  1. Create a page with scripted animation.
  2. Let page scripts to utilize methods provided by this extension to record the animation.
  3. Get the resulting video file and use it as needed.

Why

The tool was created because I needed to record a small dummy video for testing an HTML5 video player project and I couldn't find a way to do so without using ancient/buggy/bloated/ad-infested/overpriced software.

How does it work

Chrome provides extensions a way to record what is happening in a tab: chrome.tabCapture.

MediaRecorder API provides a simple way to record media streams.

This extension is a bridge between your page scripts and those functionalities.

Using that bridge, scripts can start, stop, pause/resume, and trigger downloading of the recording when they need to, and you don't need to fiddle with video editing software to crop it.

How to use

  1. Install the extension.
  2. Include the ./api.js file to the page that will coordinate the recording.
  3. Use the API.

See API docs and the source code of the demo.

Notes

Limitations

  1. Simultaneus recording of multiple tabs is not supported.
  2. I didn't implement any error handling - it was tedious enough to pass data between 3 isolated layers. If something is not working, look into the console output of both the host page and of the extension background page. You're welcome to add error handling and submit a PR.
  3. Last tested with Chrome 52. Browser APIs are evolving over time and it might not work with newer versions.

Security features

  1. The extension does not provide a way to consume the recorded activity in any form except for by explicitly sending the file to download to the user who started the recording.
  2. There is no way to start a recording without a user consent, which is given by clicking the toolbar button.
  3. The recording is not interrupted on page reload, and can be controlled and downloaded after visiting other pages, but only from the same domain where it was started at.

Tips

  1. Add a small (~100 ms., varies) delay before calling coordinatedCapture.stop() so that the frame with the final state could have a chance to be recorded.

License

MIT