Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions .eslintrc

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ build
web-ext-artifacts

# Other
todo
/profile
24 changes: 21 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
# Changelog
All notable changes to this project will be documented in this file.

## [3.12.0] -
### Changed
- **BREAKING** More readable flags for matching types. For example, to mark a matching pattern in the map as a regular expression, use the flag `r` (`{r}^face[bc]ook.com`). For a glob expression use flag `g` (`{g}*.google.com`).
- **BREAKING** Option 'Match domain only' is not global anymore. It can be set for any host in the map via the flag `d` (for example, `{gd}*.google.com`).

## [3.11.0] - 15 Feb 2025
### Added
- Better handling of eTLDs (thank you, [mook](https://github.com/mook)).
- Case insensitive matching (thank you, [raghur](https://github.com/raghur)).
- Support container names in matching rules (thank you, [AlexVallat](https://github.com/AlexVallat)).
- Add support for container colors and icons.


## [3.10.0] - 15 Feb 2025
### Changed
- Rename the extension to be able to re-upload the extension to AMO.


## [3.9.0] - 10 Feb 2021
### Added
- Remove temporary tabs if keepOldTabs is true. Fixes #93
Expand All @@ -10,12 +28,12 @@ All notable changes to this project will be documented in this file.


## [3.8.1] - 07 Nov 2020
### Added
### Added
- Add "pinned", "discarded", and "isInReaderMode" properties when opening new tabs.


## [3.7.0] - 26 Oct 2019
### Fixed
### Fixed
- Fix matchDomainOnly without host prefix.

### Changed
Expand Down Expand Up @@ -78,7 +96,7 @@ All notable changes to this project will be documented in this file.
- Support for Regex patterns (`@.+\.google\.com$` --> `.+\.google\.com$`)
- Support for Glob patterns (`!*.google.com` --> `*.google.com`)
- Ignore lines starting with `#` during CSV import.

### Changed
- Container icons are no longer accessible, fallback to simple indicators.

Expand Down
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
MIT License

Copyright (c) 2017 Kintesh
Copyright (c) 2025 Maxim Shpak

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
51 changes: 40 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,72 @@
# <img src="https://raw.githubusercontent.com/kintesh/containerise/master/static/icons/icon.png" alt="Drawing" width="42" align="top"/> containerise
# <img src="https://raw.githubusercontent.com/max-dw-i/container-redirect/master/static/icons/icon.png" alt="Drawing" width="42" align="top"/> Container Redirect

**!!! NOTE !!!** It's a fork of a great extension [containerise](https://github.com/kintesh/containerise) (with some small fixes and additions). All the fame and glory goes to its author [kintesh](https://github.com/kintesh). The original extension is not maintained anymore hence this fork. New features and enhancements are not planned currently, bug fixes and some bits and bobs at best.

Firefox extension to automatically open websites in a container

|![](https://raw.githubusercontent.com/kintesh/containerise/master/static/screenshots/1.png) | ![](https://raw.githubusercontent.com/kintesh/containerise/master/static/screenshots/2.png) | ![](https://raw.githubusercontent.com/kintesh/containerise/master/static/screenshots/3.png) | ![](https://raw.githubusercontent.com/kintesh/containerise/master/static/screenshots/4.png)|
|![](https://raw.githubusercontent.com/max-dw-i/container-redirect/master/static/screenshots/1.png) | ![](https://raw.githubusercontent.com/max-dw-i/container-redirect/master/static/screenshots/2.png) | ![](https://raw.githubusercontent.com/max-dw-i/container-redirect/master/static/screenshots/3.png) | ![](https://raw.githubusercontent.com/max-dw-i/container-redirect/master/static/screenshots/4.png)|
| --- | --- | --- | --- |
|Select your container and add a domain to always open all visits in the chosen container. | Add many domains as you wish. | Special `No Container` option to break out of a container. | Simple CSV based mapping of a domain to a container by name for easy backup and bulk editing. |


# Installation
Install the latest release for Firefox from [AMO](https://addons.mozilla.org/en-US/firefox/addon/containerise/)
Install the latest release for Firefox from [AMO](https://addons.mozilla.org/en-US/firefox/addon/container-redirect/)



# Usage

## Basic mapping
## Match the whole URL

1. No 'matching type' flag:

- `amazon.co.uk , Shopping` will open all `amazon.co.uk` (not subdomains) links in Shopping container.

- `amazon.co.uk/iphone26 , Shopping` will open only `amazon.co.uk/iphone26` in Shopping container.

2. 'matching type' flag `g`:

- `{g}*.amazon.co.uk, Shopping` will be treated as `*.amazon.co.uk` glob pattern. (suitable to subdomains)

- `{g}*.amazon.co.uk, Shopping` will also open links like `https://www.whois.com/whois/www.amazon.co.uk` in Shopping container.

3. 'matching type' flag `r`:

`amazon.co.uk, Shopping` will open all amazon.co.uk (not subdomains) links in Shopping container.
- `{r}.+\.amazon\.co\.uk, Shopping` will be treated as `.+\.amazon\.co\.uk` regex. (suitable to subdomains and complex paths)

## Glob
`!*.amazon.co.uk, Shopping` will be treated as `*.amazon.co.uk` glob pattern. (suitable to subdomains)
## Match only the domain

## Regex
1. No 'matching type' flag:

`@.+\.amazon\.co\.uk$, Shopping` will be treat as `.+\.amazon\.co\.uk$` regex. (suitable to subdomains and complex paths)
- `{d}amazon.co.uk , Shopping` will open all `amazon.co.uk` (not subdomains) links in Shopping container.

2. 'matching type' flag `g`:

- `{gd}*.amazon.co.uk, Shopping` will be treated as `*.amazon.co.uk` glob pattern. (suitable to subdomains)

3. 'matching type' flag `r`:

- `{rd}.+\.amazon\.co\.uk, Shopping` will be treated as `.+\.amazon\.co\.uk` regex. (suitable to subdomains)

## Matching with existing container name (settings option 'Match current container name'):

- `<>amazon.co.uk, Shopping` will open all `amazon.co.uk` (not subdomains) links in the `Shopping` container but only if the current tab is not assigned to any container (`<>` at the begining means `No Container`)

- `{r}<shopping>(?!.+\.amazon\.co\.uk).*, No Container` will open all links from inside the `Shopping` container that are _not_ `.amazon.co.uk` subdomains in the `No Container`

- `{r}<(?!profile \d).*>.+\.facebook.com, Profile 1` will open all links to `facebook.com` in the `Profile 1` container unless the current tab is already assigned to `Profile 1`, `Profile 2`, `Profile 3`, etc.

# Development

## Available Scripts
In the project directory, you can run:

#### `npm ci`
Installs required dependencies.
Installs required dependencies.

#### `npm run webpack`
Starts webpack with `--watch` option and outputs to `./build` directory.

#### `npm run build`
Builds the extension for production use.<br>

Expand Down
19 changes: 9 additions & 10 deletions docs/ui-preferences/default_containers.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# Default containers

The container into which tabs will be placed that cannot be placed into any other container.
In other words, if a tab opens or updates its URL to one that cannot be matched by a rule in the extension,
it will be put into a default container according to the preferences listed below.
The container into which tabs will be placed that cannot be placed into any other container.
In other words, if a tab opens or updates its URL to one that cannot be matched by a rule in the extension, it will be put into a default container according to the preferences listed below.

## Preferences

The title of the group, as seen by the user, will be **Default container**.
The entire group can be toggled on or off.
If off, nothing will be done with unmatched URLs.
The title of the group, as seen by the user, will be **Default container**.
The entire group can be toggled on or off.
If off, nothing will be done with unmatched URLs.

Once activated the following preferences will come into effect:

Expand All @@ -26,11 +25,11 @@ Other variables can be requested (most likely in feature requests).

Examples:

| URL | containerise_{ms} | {domain} | {fqdn} | default container |
| URL | container-redirect{ms} | {domain} | {fqdn} | default container |
|----------------------------|----------------------------|----------|--------------------|--------------------|
| https://example.com | containerise_1567718601836 | example | example.com | default container |
| https://old.example.com | containerise_1567718628706 | example | old.example.com | default container |
| https://an.old.example.com | containerise_1567718738989 | example | an.old.example.com | default container |
| https://example.com | container-redirect_1567718601836 | example | example.com | default container |
| https://old.example.com | container-redirect_1567718628706 | example | old.example.com | default container |
| https://an.old.example.com | container-redirect_1567718738989 | example | an.old.example.com | default container |

**Lifetime** (choice list)

Expand Down
42 changes: 42 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import globals from "globals";
import babelParser from "@babel/eslint-parser";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

export default [...compat.extends("eslint:recommended"), {
languageOptions: {
globals: {
...globals.browser,
...globals.node,
...globals.jest,
browser: true,
},

parser: babelParser,
ecmaVersion: 6,
sourceType: "module",

parserOptions: {
ecmaFeatures: {
experimentalObjectRestSpread: true,
},
},
},

rules: {
semi: 2,
quotes: [2, "single"],
eqeqeq: 2,
"comma-dangle": [2, "always-multiline"],
},
}];
Loading