Skip to content

Browser extension to automatically redirect top level domains according to predefined rules.

License

Notifications You must be signed in to change notification settings

maxmilton/browser-redirect

Repository files navigation

Build status Licence

Browser Redirect

Browser Redirect is a browser extension that redirects top level domains according to predefined rules. It uses the declarativeNetRequest API, which provides a faster and more secure way to handle redirects than other alternatives, as it cannot read the content of web pages.

The extension comes with a predefined set of static rules that are geared towards privacy friendly alternative frontends. You can customize it to meet your specific needs.

Default Redirect Rules

The following table shows the default redirect rules included in the extension:

From To
www.reddit.com libreddit.pufe.org
old.reddit.com libreddit.pufe.org
www.youtube.com piped.video
www.youtube-nocookie.com piped.video
m.youtube.com piped.video
youtu.be piped.video/watch?v=
twitter.com nitter.pufe.org
imgur.com rimgo.bcow.xyz
www.quora.com quetre.pufe.org
imdb.com libremdb.iket.me
medium.com scribe.rip
*.medium.com scribe.rip/@*
wikipedia.org wikiless.pufe.org
en.wikipedia.org wikiless.pufe.org
stackoverflow.com code.whatever.social

Usage

Follow these steps to use Browser Redirect:

  1. Install the Bun JavaScript runtime, if not already installed.
  2. Clone the project and edit the rules.ts file to add custom redirect rules.
  3. Build the project using bun run build.
  4. Load the extension into your browser:
    1. Navigate to chrome://extensions/.
    2. Toggle "Developer mode" to the "on" position.
    3. Click "Load unpacked" and select the dist directory.
  5. To enable redirecting in private tabs, toggle "Allow in Private" to "on" in the extension's "Details" page.

Pre-built Package

If you are satisfied with the default rules, you can download chrome-extension.zip from the latest release. Then follow the instructions above starting from step 4, except instead of the dist directory, select the downloaded zip file.

Optional Linting

  1. Install the project dependencies: bun install
  2. Run linting: bun run lint

Browser Support

Browser Redirect is compatible with version 84 and higher of Google Chrome and other Chromium-based browsers like Brave and Edge.

Bugs

Report any bugs you encounter on the GitHub issue tracker.

Known Issues

We are aware of the following issues:

  1. User's cannot dynamically add new rules. This is by design, as the extension uses a static rule set to simplify the implementation. You need to edit rules.ts and rebuild the project to make changes.
  2. The extension is not installable via the Chrome Web Store. Build the extension with your own custom rules using the steps outlined above.

Changelog

See releases on GitHub.

License

MIT license. See LICENSE.

The right arrow icon is from twitter/twemoji which is licensed CC-BY 4.0.


© 2024 Max Milton

About

Browser extension to automatically redirect top level domains according to predefined rules.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published