Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

firefox-hash-generator

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

firefox-hash-generator

  • 1.0.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Firefox/Waterfox/Pale Moon Hash Generator

This library generates the hashes for firefox and derived browsers' search engine file. The hash is needed to programmatically set the default search engine.

Usage

require 'firefox_hash_generator'

FirefoxHashGenerator.generate( :firefox, 'randombytes.default', 'DuckDuckGo', )

The first argument is the browser app name. This can be retrieved from the browser console by typing Services.appinfo.name for your browser. Note that the input control is disabled by default and is enabled by setting the about:config pref devtools.chrome.enabled to true.

The app name can be provided as a string or, for convenience, a symbol that maps the known browsers to their app names. Currently the following browsers are known:

  • :firefox
  • :pale_moon
  • :waterfox

The second parameter is the basename of the profile directory. It usually consists of a randomly generated string followed by the profile name.

The third parameter is the name of the search engine that is being set as the default one.

The entire process was copied from this amazing guide by Frederick Zhang.

To extract the JSON serialization of the search engine configuration from the search.json.mozlz4 file (which contains a proprietary header followed by the LZ4-compressed JSON), use a utility like lz4jsoncat or this Python code (which originated from this Python code). For Ruby, a working LZ4 compressor/decompressor is extlz4.

Bugs & Patches

Please report via issues and pull requests.

License

MIT

FAQs

Package last updated on 07 Jul 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc