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

flash-player-loader-extra

v1.2.1

Published

Makes life easier for the electron apps which need the pepper flash player.

Downloads

3

Readme

Flash Player Loader Extra (for electron apps)

This repository forks from the flash-player-loader, matains extra changes.

Makes life easier for the electron apps which need the Pepper Flash Player.

The path to the Flash Player for your app usually differs between develop (git) version and release (packed) version.
This module manages multiple sources for you, and provides extra debug information and error handling.
Plus some handy features (OS X only) like automatically locate the Flash Player and get the version of it.

More details can be found at electron docs.

Installation

npm install --save flash-player-loader-extra

Debug

Clone the flash-player-loader-extra project from github:

git clone https://github.com/Jinzy/flash-player-loader-extra-for-electron.git

To run the example app:

cd /path/to/flash-player-loader
npm install
electron test

To run the example app with extra debug output:

electron test -d

Usage

var flashLoader = require('flash-player-loader');
var path = '/path/to/dir/contains/flash/player';
flashLoader.addSource(path);
flashLoader.addSource('/alternative/path');
var versions = flashLoader.getAllChromeFlashVersions();
console.log(versions[0][1]);
flashLoader.addSource(versions[0][1]);
flashLoader.load();

Alternatively, you can chain the methods together.

require('flash-player-loader').addSource('/path/to/dir').load();

Do not forget to add the 'web-preferences': {'plugins': true} option when creating your BrowserWindow.

See test/index.js for more detailed example and explanations.

Get Pepper Flash Player Plug-in

  • Install Google Chrome.
    You can find the path to the Pepper Flash Player in the chrome://plugins tab.
  • Install the PPAPI system plug-in.
  • You can also download and install any older version of the plug-in from here.

Troubleshooting

The path added is correct, but it doesn't load the plug-in
  1. Please make sure that you are not mixing the architecture of electron and Flash Player.
    That is, 32-bit electron will not work with 64-bit Flash Player, and vice versa.
  2. Please make sure that you have included the option 'web-preferences': {'plugins': true} when creating BrowserWindow.

API

flashLoader.getFilename()

Returns the Flash Player filename according to the running OS.

flashLoader.addSource(location[, version])

  • location String
  • version String (optional)

Adds the location of Pepper Flash Player.

This method can be called multiple times. All added sources will be validated in the order they are added, until the first valid one is found.

The location is the path to the directory contains the Pepper Flash Player file, or the full path to the Pepper Flash Player file (The filename has to match the string returned by flashLoader.getFilename()).
If you have electron v1.2.3 or newer, you can also specify "@system" for location. It will then look for the Pepper Flash Player system plug-in (PPAPI).
If location is omitted, '.' will be used, i.e., the working directory, where you started your app.
On OS X, you can always specify "@chrome" or "@system" for location.
If "@chrome" is specified, it will automatically look for the Pepper Flash Player integrated by the newest installed Google Chrome.
"@system" works for all versions of electron.

You can optionally pass in a version string, which will be passed to Chromium with the ppapi-flash-version switch.
Note:

  1. Google Chrome uses this version number to decide which Flash Player to load, and for displaying. However, for (most) electron apps, it's useless. It's safe to ignore the version string.
  2. On OS X, the Flash Player version is automatically detected. The passed in string is ignored.

This method returns this, so it's possible to chain it.

flashLoader.load()

Validates the source(s) added by addSource(), in the order they are added. The first valid one will be loaded.

flashLoader.debug([options])

  • options Object
    • enable Boolean - Enable/Disable debug mode. Default is true.
    • log Function - Customised log function. Default is console.log.
    • error Function - Customised error function. Default is console.error.

Enable or disable debug mode.
When enabled, extra information and error messages will be print to the console.
You can also specify a customised log/error function, to make the output format match other output of your app, or log the information in other forms (e.g., write to a log file).
Note you may need to use bind to make you log function callable.
(See the example app for instance.)

This method returns this, so it's possible to chain it.

flashLoader.getVersion(location) OS X

  • location String

Returns the version of the Flash Player found at the specified location. An empty string is returned if the location is invalid.