0.1.0 • Published 3 months ago

rusted-chromium v0.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
3 months ago

rusted chromium

NPM Version Package License Build Status

TestCoverageReport
Unit testsCoverage Statuscoverage
Integration testsCoverage Statuscoverage-int

This cli tool can be used to download old (and therefore unsupported) versions of chromium.

Table of contents

Disclaimer 🔥

Reasons to use this tool:

  • Verify that bugs that look browser-version-related, really are.

Reasons to NOT use this tool:

  • Reobtain removed functionality in Chrome(-ium)

To be explicit:

⚠️ The downloaded versions are OUTDATED and UNSUPPORTED! Some known and exploitable bugs, that are already fixed on newer versions, still exist. That's why new versions were released! Use this only for debugging purposes for websites YOU CONTROL! NEVER use these versions for browsing! NEVER EVER enter private data in these browser versions and NEVER EVER login to accounts with these browser versions!!! ⚠️

Installation

ⓘ Versions older than 0.1.0 are not working anymore. Please see the FAQ and upgrade.

via npm

npm install -g rusted-chromium
rusted-chromium --help

via docker

docker pull buzztt/rusted-chromium

mkdir out
docker run -ti --mount type=bind,source="$(pwd)/out",target=/app/out-dir rusted-chromium --folder out-dir

Build on your own

using npm

git clone https://github.com/BuZZ-T/rusted-chromium
cd rusted-chromium
npm install
npm test

# using ts-node
npm start -- --help # the two extra dashes are important to pass arguments to the script!
# building and running
npm run build
./bin/rusted-chromium.js --help

using docker

git clone https://github.com/BuZZ-T/rusted-chromium

cd rusted-chromium
docker build -t rusted-chromium .

Supported node versions

16.x, 18.x, 20.x, 21.x

All available flags

FlagShortParameterDefaultDescription
--single-sstring-Use a specific version. No interactive prompt is displayed. The Store file is ignored, several other flags have no effect (like -d, -i, -n, -M, -m, -r and -O). Terminates with an error status code of 1, if no binary exists.
--max-Minteger10000Maximum version which should be selectable.
--min-minteger0Minimum version which should be selectable.
--max-results-rinteger10Maximum number of results to select. Directly downloads the binary, if set to 1. Important: --max-results is set to Infinity, if --min is set and --max-results is not set, so the default is overridden!
--os-o"win"/"linux"/"mac"/"darwin"The operation system on the current systemSet the operation system of the binary.
--arch-a"x86"/"x64" for "win" or "linux. "x64"/"arm" for "mac"The architecture on the current systemSet the architecture of the binary. The flag is only regarded, if --os is present.
--unzip-z--Directly unzip the downloaded zip-file and delete the .zip afterwards
--decrease-on-fail-d--Automatically try the next lower version, if the selected version has no binary.
--increase-on-fail-i--Automatically try the next higher version, if the selected version has no binary.
--non-interactive-n--Don't display the version selection. Automatically select the newest version in the available range (set by --min, --max and --max-results). Only works when --decrease-on-fail is set as well.
--no-download-l--Don't download the binary if it's found.
--import-store-IURL/File path-Download the store file "localstore.json" from a given URL or load it from a given path of the filesystem. Merges the import with an already existing store.
--export-store-E(optional) File path-Exports the "localstore.json" file to stdout. Optionally add a path where to find it. Uses "localstore.json" in the current folder of the rusted-chromium executable as default.
--no-store-t-falseDon't add negative hits to the existing store
--ignore-store-S-falseDon't use the store to disable already known negative hits
--hide-negative-hits-H-falseHide negative hits in the CLI prompt
--folder-fpath/to/folderCurrent folder executing the commandSet the folder to which the archive of the chromium binary or the extracted folder (if the flag --unzip is set)
--only-newest-major-O--Show only the newest version for every major version in the user selection. If the newest versions are not available for the current os, they are skipped.
--list-falseOnly log all matching versions to stdout, quit the program afterwards.
--quiet-q-falseSuppress all log output.
--no-color-c-falseSuppress colors in log output.
--debug-falseAdd additional debug logging.
--version-V--Show current version.
--help-h--Display a help with all available flags.

Examples

Download a specific version, exit and fail if it does not exist
# long version
rusted-chromium --single 70.0.3539.100
# short version
rusted-chromium -s 70.0.3539.100
Define a minimum and maximum major version
# long version
rusted-chromium --min 60 --max 70
# short version
rusted-chromium -m 60 -M 70
Define a maximum major/minor version

NOTE: Currently makes no sense, as the minor version is always "0".

rusted-chromium --max 70.0
Define a maximum major/minor/branch version
rusted-chromium --max 70.0.3539
Define a maximum major/minor/branch/patch version
rusted-chromium --max 70.0.3539.100
Define a maximum version and an amount of results
# long version
rusted-chromium --max 70 --max-results 30
# short version
rusted-chromium -M 70 -r 30
Don't download anything, just mark negative hits in the local store
# long version
rusted-chromium --max 80 --decrease-on-fail -non-interactive --no-download
# short version
rusted-chromium -M 80 -dnl
Directly download the version without interactive selection

NOTE: This supports --max --min as well!

# long version
rusted-chromium --max-results 1
# short version
rusted-chromium -r 1
Automatically unzip the downloaded archive
# long version
rusted-chromium --unzip
# short version
rusted-chromium -z
Automatically try the next lower version, if the selected version has no binary

NOTE: This regards --min, --max and --max-results

# long version
rusted-chromium --max 30 --decrease-on-fail
# short version
rusted-chromium -M 30 -d
Automatically try the next higher version, if the selected version has no binary

NOTE: This regards --min, --max and --max-results

# long version
rusted-chromium --max 30 --increase-on-fail
# short version
rusted-chromium -M 30 -i
Automatically select the newest of 7 results and automatically try the next lower version, if the tried version has no binary
# long version
rusted-chromium --max 78 --max 79.0.3909.0 --max-results 7 --decrease-on-fail --non-interactive
# short version
rusted-chromium -M 79.0.3909.0 -r 7 -d -n
Download to an alternative directory
# long version
rusted-chromium --folder /tmp/rusted
# short version
rusted-chromium -f /tmp/rusted
Import a store file (and merge it with an existing store, if available)
# URL
## long version
rusted-chromium --import-store https://url/to/localstore.json
## short version
rusted-chromium -I https://url/to/localstore.json

# filesystem
## long version
rusted-chromium --import-store /path/to/file
## short version
rusted-chromium -I /path/to/file
Export a store file (from default location)
# long version
rusted-chromium --export-store
# short version
rusted-chromium -E
Export a store file (from given path)
# long version
rusted-chromium --export-store /path/to/file
# short version
rusted-chromium -E /path/to/file
Suppress colors in log output
# long version
rusted-chromium --no-color
# short version
rusted-chromium -c
Suppress all log output
# long version
rusted-chromium --quiet
# short version
rusted-chromium -q
List all matching versions and quit
rusted-chromium --list
Show the help and quit
# long version
rusted-chromium --help
# short version
rusted-chromium -h
Show the version and quit
# long version
rusted-chromium --version
# short version
rusted-chromium -V

Store file

It's possible that for a given combination of

  • operating system (windows/linux/mac)
  • architecture (x86/x64 for Win/Linux or x64/arm for mac)
  • version (e.g. 63.0.3239.150)

a binary might be not available. The reason for this is, if a new patch is released, it might only fix bugs for a certain combination of operating system and architecture. For all other combinations might no new version be released. Unfortunately, this can only be detected at the very end of the api-call chain.

Every time a "negative hit" (so no binary is available) is detected, this is written to a Store file localstore.json in the same folder as the rusted-chromium executable. The next time a range of versions is requested by rusted-chromium, this version is automatically marked as "not-available".

Download Store file

You can use rusted-chromium to download an existing localstore.json file, to setup an initial state of known unexisting binaries. This project provides one under https://rusted.buzz-t.eu/localstore.json, but there is no need to use it.

Chromium Version Format

A chrom(e/ium) version might look like this: "60.0.3112.93". The version can be split in:

  • Major version (here: "60")
  • Minor version (here: "0")
  • Branch version (here: "3112")
  • Patch version (here: "93")

The minor version is not used and is always "0".

Contrary to what semantic versioning would require, the branch version is not reset to zero, when the major version is increased. Instead, the branch version is also increased.

E.g. the latest 60.x version is "60.0.3112.118", the first 61.x version is "61.0.3113.0".

Partial Chromium Version Format

When declaring the Chromium Version Format in rusted-chromium, prefixes can be used. E.g.:

  • "60" means "any version with major version 60"
  • "60.0.3112" means "version 60.0.3112 with arbatrary patch version"

Use as API

rusted-chromium can be used as API as well. See more examples here.

Import store

To import a store file, use importAndMergeStore:

import { importAndMergeLocalstore } from 'rusted-chromium';

importAndMergeLocalstore({
    url: '...', // File or URL
});

Download chromium

To download a chromium version, use downloadChromium:

import { ComparableVersion, downloadChromium } from 'rusted-chromium';

downloadChromium({
    arch: 'x64',
    autoUnzip: false,
    color: true,
    debug: false,
    download: true,
    downloadFolder: null,
    hideNegativeHits: false,
    ignoreStore: false,
    interactive: true,
    inverse: false,
    list: false,
    max: new ComparableVersion(95, 0, 0, 0),
    min: new ComparableVersion(0,0,0,0),
    onFail: 'nothing',
    onlyNewestMajor: false,
    os: 'linux',
    quiet: false,
    results: 10,
    single: null,
    store: true,
})

Directly pass CLI flags

If you want to directly pass process.argv and extend or restrict the available flags, directly import rusted:

import { rusted } from 'rusted-chromium'

rusted(process.argv, 'linux')

Use defaults and override specific settings

This is probably the most useful version in a CI envionment. This requires less config options, as many of them are not regarded when using single.

import { downloadChromium } from 'rusted-chromium';

downloadChromium.withDefaults({
    arch: 'x64',
    single: "10.0.0.0",
    os: 'linux',
    autoUnzip: false,
    download: true,
    downloadFolder: null,
});

Use the fluent API

The fluent API can be accessed by using .with.

import { downloadChromium } from 'rusted-chromium'

downloadChromium.with
    .arch('x64')
    .os('linux')
    .interactive()
    .start()

For the single mode (in normal config single: <version>), use .withSingle:

downloadChromium.withSingle
	.download()
	.autoUnzip()
	.single('10.11.12.13')
	.start()

Be aware that .start() is only available, after single(...) has been used.

See more examples to use the API here.

FAQ

Why do you often write "Chrom(e/ium)"?

The famous browser chrome is based on the free licensed browser chromium. If you use rusted-chromium, you are downloading a chromium version. The versioning are used for both chrome and chromium so "Chrom(e/ium)" means "the version of chrome and/or chromium"

Can i contribute?

I'm accepting pull requests and feature requests (no guarantee that i will implement this fast or implement this at all, but feel free to ask).

Do you build chromium versions? Do you store chromium binaries/archives? Do you have your own chromium repository?

NO, NO and NO. This CLI basically automates the manual steps mentioned here. So only official chromium APIs are called and only official binaries are downloaded.

So, this project:

  • has NO own repository for chromium sources
  • does not build versions of chromium itself
  • does not store binaries or archives of chromium

I'm starting a downloaded version, but it has the same version as my normally installed one...

A session with the newer version was still running. In this case, chrom(e/ium) detects that and launches a window in the same session. There are two possible solutions for this:

  • Make sure to first close all running instances of chrom(e/ium)!
  • Start your downloaded version of chromium with the flag --user-data-dir=<folder>. See chromium.googlesource.com for more information.

rusted-chromium is not working anymore. I get a 410 Gone HTTP-Statuscode from a chrome API...

The OmahaProxy, which API was used by rusted-chromium, has been switched off. Which version 0.1.0, rusted-chromium migrated to ChromiumDash and is functional again. But earlier versions, which version number "0.0.X" are not usable anymore. Be sure to install version 0.1.0 or later!

0.1.0

3 months ago

0.0.20

4 months ago

0.0.21

4 months ago

0.0.18

8 months ago

0.0.19

8 months ago

0.0.17

2 years ago

0.0.15

2 years ago

0.0.16

2 years ago

0.0.14

3 years ago

0.0.13

3 years ago

0.0.12

4 years ago

0.0.11

4 years ago

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago