GithubHelp home page GithubHelp logo

libredirect / browser_extension Goto Github PK

View Code? Open in Web Editor NEW
3.0K 26.0 107.0 79.66 MB

A browser extension that redirects popular sites to alternative privacy friendly frontends

Home Page: https://libredirect.github.io

License: GNU General Public License v3.0

JavaScript 74.42% HTML 0.72% CSS 6.90% Python 2.10% Pug 15.86%
firefox-extension privacy libre quora twitter webextension youtube bibliogram chrome-extension invidious

browser_extension's Introduction

A browser extension that redirects YouTube, Twitter, TikTok... requests to alternative privacy friendly frontends and backends.

 

Translate

Development

Install Node.js

git clone https://github.com/libredirect/browser_extension
cd browser_extension
npm install
npm run html # Generates html using Pug

Run on Firefox

npm run start

Build a zip package for Firefox

npm run build

Install the zip package on Firefox (temporarily)

  1. Type in the address bar: about:debugging#/runtime/this-firefox
  2. Press Load Temporary Add-on...
  3. Select libredirect-VERSION.zip from web-ext-artifacts folder

Install the zip package on Firefox ESR, Developer Edition, Nightly

  1. Type in the address bar: about:config
  2. Set xpinstall.signatures.required to false
  3. Type in the address bar: about:addons
  4. Click on the gear shaped settings button and select Install Add-on From File...
  5. Select libredirect-VERSION.zip from web-ext-artifacts folder

Run on Chromium

  1. Open chrome://extensions
  2. Enable dev mode
  3. Select load unpacked extension
  4. Select src folder

Forked from Privacy Redirect

browser_extension's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

browser_extension's Issues

[Question] Medium to Scribe, I'm puzzled

Hi,

Be it LibRedirect, be it Scribe's solution to redirect Medium posts to Scribe via the Redirect extension, there's a point which puzzles me.
This is not related to LibRedirect itself, but rather to the logic of Scribe's redirection. No way to contact Scribe's developer so if LibRedirect's developer or anyone else has the answer, many thanks.

Medium to Scribe redirections send all Medium requests to Scribe (scribe.rip in my case/choice). This means basically that medium's homepage https://medium.com is redirected to https://scribe.rip which of course has no content.

The only logic I found in this redirection is to consider that the user never opens Medium's homepage, but uses the redirection in the context of Web searches on the Medium site, i.e. https://duckduckgo.com/?q=%s+site:medium.com. In this scenario, Medium to Scribe is perfect, but otherwise I remain puzzled that the redirection code does not include an exception for https://medium.com/ as such...

I hope you get the idea!

Many thanks and long life to LibRedirect.

how to remove parameters added at the end of url

I had this issue with the last addon with addon adding parameters to the ulr and there was no way to remove them
SimonBrazell/privacy-redirect#162

basically once a user touch any setting in the youtube redirect section for parameters they get added to urls and there is no way to remove them and there is no way to reset the addon so if in the pristine addon installation the audio volume was 50 and user changes that to 51 then there will be a parameter added to urls of youtueb (even playlist or searches) and moving the audio option back to 50 doesnt remove that.

The invidious redirect Blocks Google Meet videos

I have Privacy Redirect to redirect youtube to invidious, however the company I work for uses Google Meet and I noticed that instead of the video meetings just working, it gets stuck on "waiting for streaming to begin, please stand by".

As soon as I turned off the redirect extension it worked fine. I actually missed the first half of a meeting thinking it was just starting a bit late before I realised what was going on the first time because there is no prompt or error message to tell me why my meeting hadn't started yet with it had. All good though, awesome work!
CC: @MattyGWS
From SimonBrazell/privacy-redirect#348

Add Imgur Redirection Support

There are 3 Imgur privacy-respecting front-ends out there:

They also have some public instances (official/unofficial). Adding this feature would be appreciated.

Can't add to reddit redirect list

Whenever i try to add sites to the reddit redirects list it resets after reloading the addon config screen. (and the websites added are never put into affect)

redirect on current tab when invidious tab video has an error

redirect on current tab when invidious tab video has an error.

when I open a youtube link that has as error (for example adult flagged video so need login or not loading for other reasons)
then the invidious tab seem to try to refresh again and again untill error in gone. I think this is from this addon because I have set only one invidious instance.
so far that is not bad.
but the issue is that when that refresh (technically redirect) happens, if I switch to another tab then that tab gets redirected to the invidious url.
this seems to be a bug (kinda serious if you ask me) in handling of tab and urls in this addon.

right now I dont have a repeatable url for youtube to test this because the ones I has encountered for this bug , after manual refresh of page they load fine.

please check the addon code for this redirect and fix this.

it may be an internal logic of invidious itself that refresh the page but because when I use the older addon (privacy redirect) I dont get this bug I think this is the libreredirect issue.

Add Old Reddit as an option to the Reddit Frontend Selection

Currently only Libreddit and Teddit can be selected as alternative frontends, which only allow read access. I would like to be able to use old.reddit.com which still allows me to be logged in and participate. I see it is already in the reddit helper's redirects dictionary as "desktop", I think it would make sense to expose this as a separate entry in the dropdown.

Youtube Redirect Bugs

When trying to modify the settings for Piped and Invidious, the options for Theme, Autoplay Video and Always proxy videos don't seem to save and persist after changing them from default, leaving the page then returning to it.

Bring Back exceptions

Currently to use a specific instances we need to remove all the checkboxes. I think this is messy. Instead Old UI is better.

Why there is no exceptions Option ?

Export settings to a JSON file

Adding a button to reset options to default/clear extension data may be beneficial, especially when dealing with issues such as #55 or helping users who want to fix something they misconfigured.

[Bug] Unexpected redirections using random instances with Piped and embedded-videos

Hi, I'm using Libredirect with Piped and random instances for both embed and non-embed videos. For some reasons in sites with multiple embedded YouTube links, loading the sites sometimes causes redirections to piped websites. It's really random, and sometimes you have to reload the page a few times to see it happens.

The URLs it redirects to can be different too:

https://youtube.com/sw.js?theme=dark&playerAutoPlay=false
https://youtube.com/embed/bHQqvYy5KYo?enablejsapi=1&theme=dark&playerAutoPlay=false

and these links will be redirected to piped instances at the new non-embed site.

For example:

  • URL:
    https://developers.google.com/youtube/iframe_api_reference

  • Firefox 97.0, Libredirect 1.3.4 + ublock 1.41.2.

Video for demonstrating the bug (at the end it automatically redirects to youtube.com/embed and goes to piped instance at new non-embed site):

redirect.mp4

I'm not sure if it's related to randomizing the links or not. When I changed to just 1 instance, I haven't got the bug yet.

Unticking "Toggle All" freeze the browser

If the user untick "Toggle All" (instances), the whole browser will freeze, and basically crash.

This makes it impossible to choose a specific instance.

Recording of the issue (on an almost "stock" Firefox ESR, after a fresh install of the addon):

firefox.mp4

Whoogle redirects back to google.

Every instance has disappeared

I’m on the latest release, and Reddit was working before, and then I switched to Tor, then all instances have disappeared (I’m running latest Tor Browser release aswell)

66758690046__9AB072BD-CD47-435D-9D35-5F266134CC64.MOV

Latest version (1.4.0) not working

Using it on a linux machine (POP OS) running Firefox.

Settings do not save whether via the toolbar pop up or options page.

Instances list is not displayed for YouTube or Twitter.

02-21-2022_1

I tried adding a custom instance too but it does not show up.

All redirects, even when enabled, are not working.

Specify SimplyTranslate engine

SimplyTranslate has more backend engine than just Google Translate (ICIBA, Reverso, LibreTranslate). In my case ICIBA translation quality is better than Google Translate. I'd glad to have the ability to specify translation engine for SimplyTranslate build into LibRedirect.

[Suggestion] Option to redirect only non-embedded YouTube videos

LibRedirect includes the option to redirect only embedded videos.
I believe an option to redirect only non-embedded videos would be pertinent.

Why?

Redirected embedded videos, at the best, aren't displayed as promptly as when non-redirected.
Several redirected embedded videos connect nevertheless the user's device to YouTube servers (see TeamPiped/Piped#786 (comment))

My approach is that I see little advantage of redirecting embedded YouTube videos (sluggish quite often, non 100% privacy reliability).
But I do enjoy all the advantages of redirecting all non-embedded videos to either Invidious or Piped instances (speed, 100% privacy).

Personally I continue to redirect non-embedded YouTube sites to Invidious or Piped instances via the Redirector extension because at this point neither LibRedirect nor Privacy Redirect offer the option to handle only non-embedded YouTube videos.

Add support for Piped Material

DISCLAIMER: I'm the sole developer of Piped Material, but I think users will appreciate this feature and at least one user has asked for this.

Piped Material is a fork off Piped, with a few advantages. It'll be nice to see it as an option beside Piped. It uses the same API as Piped and therefore instances, but not the frontends.

There's a grid of frontend instances in the repo below, I'd recommend only adding the production instance for now.

URL: https://github.com/mmjee/Piped-Material

Piped

Piped is Privacy-oriented YouTube Frontend which is like Invidious but uses Javascript. I think you can add it as a Separate option instead of mixing in the Invidious Instance Pool.

Open Issue in Main repo : SimonBrazell/privacy-redirect#181

[Enhancement] Option to disable Piped/Invidious embeds in some sites

Because of how each site implementing YouTube Player API, there might be some sites that can't play Piped/Invidious embedded videos. In this case, I think we could implement an Exceptions part in YouTube section so users can add their own whitelisted sites that are not compatible to Piped/Invidious embeds.

URL to test (I'm not sure if the site could be region-blocked or not):

https://xahoingaynay.com.vn/video/bi-quyet-xem-bong-da-cua-blv-quang-huy.html

Configuration: enabling Piped with both or Only Embedded Videos
Behavior: clicking on the button to play cannot trigger the video player to play.

Users can input the site https://xahoingaynay.com.vn as an exception to not redirecting that embedded video to Piped/Invidious.


Approach: with onBeforeRequest API, we can extract frameAncestors attribute which indicate the main_frame of the site (in this case https://xahoingaynay.com.vn/video/bi-quyet-xem-bong-da-cua-blv-quang-huy.html).

When I edited the code in background.js like below and rebuilt the extension, I can force Libredirect to not using redirections on this site, but still work normally on other sites, for example https://developers.google.com/youtube/iframe_api_reference:

background.js
"use strict";

import youtubeHelper from "../../assets/javascripts/helpers/youtube/youtube.js";
import twitterHelper from "../../assets/javascripts/helpers/twitter.js";
import instagramHelper from "../../assets/javascripts/helpers/instagram.js";
import redditHelper from "../../assets/javascripts/helpers/reddit.js";
import searchHelper from "../../assets/javascripts/helpers/search.js";
import translateHelper from "../../assets/javascripts/helpers/translate.js";
import mapsHelper from "../../assets/javascripts/helpers/maps.js";
import wikipediaHelper from "../../assets/javascripts/helpers/wikipedia.js";
import mediumHelper from "../../assets/javascripts/helpers/medium.js";
import imgurHelper from "../../assets/javascripts/helpers/imgur.js";
import tiktokHelper from "../../assets/javascripts/helpers/tiktok.js";
import exceptionsHelper from "../../assets/javascripts/helpers/exceptions.js";

// Adding exception URLs
var exceptionUrls = [
  "https://xahoingaynay.com.vn",
];

window.browser = window.browser || window.chrome;

function wholeInit() {
  mapsHelper.init()
  searchHelper.init()
  translateHelper.init()
  instagramHelper.init()
  mediumHelper.init()
  redditHelper.init()
  twitterHelper.init()
  wikipediaHelper.init()
  youtubeHelper.init()
  imgurHelper.init()
  tiktokHelper.init()
  exceptionsHelper.init()
}

wholeInit();

browser.storage.onChanged.addListener(wholeInit);

browser.webRequest.onBeforeRequest.addListener(
  (details) => {
    const url = new URL(details.url);
    let initiator;
    if (details.originUrl)
      initiator = new URL(details.originUrl);
    else if (details.initiator)
      initiator = new URL(details.initiator);

    var newUrl;

    if (exceptionsHelper.isException(url, initiator)) newUrl = null;

    else if (youtubeHelper.isYoutube(url, initiator)) {
      newUrl = youtubeHelper.redirect(url, details.type);
      // Check if frameAncestors is in exception lists or not
      for (const except of exceptionUrls) {
        if ((details.frameAncestors.length !== 0) && details.frameAncestors[0].url.startsWith(except))
          newUrl = null;
          break;
        }
      }
    }
    // ...
  });
// ...

I'm not good at coding so this is the best I can do to describe it. Hope it helps.

Low contrast in setting page (light mode)

I find the current heading color (#fbc117) to be quite low contrast (1.33:1), which is quite hard to read.
WCAG Standard states that the contrast ratio should be at least 3:1.

I would suggest some color with better contrast on background like #0b5394, though I haven't found a good looking yellowish color that is easy to read in light mode.

permissions issue

Hello,

this addon seems like a great extension of the one its forked from, but the permission to access all data on all websites seems a bit overkill imo.

Wouldnt asking for permission for the specific sites it wants to redirect from (wikipedia, twitter etc.) be more privacy friendly?

Greetings

Allow FreeTube redirects alongside Invidious/Piped Embeds

Currently, setting FreeTube as a redirect for YouTube videos means that embedded videos simply do not show up.

In the original Privacy Redirect extension one could have YouTube redirect to FreeTube while still replacing embedded videos with Invidious/Piped with the "Use FreeTube over Invidious when possible" option. Without this option FreeTube isn't really usable, since it breaks all embeds.

Thank you for your hard work -- this extension is indispensable.

[Feature Request] Redirect link of other instances to the chosen instance

Copied from SimonBrazell/privacy-redirect#50

Invidition support a feature (only for Invidious) named "Always use prefered", it's a feature that redirect every Invidious links of public instances to the chosen instance.

It would be really nice if it was possible to do in Libredirect, either using regex (preferable but might cause some issue in website using the same URL format) or using the list of public instance of each service (how it's implemented in Invidition) either by scraping the list (how it's implemented in Invidition) or by having the list directly in the code.

Issues to import here

I think these are some fundamental issues that need to be imported from the Main repo and Make it available on Libredirect.

Here are the Issues :
344, 340, 320, 313 (Imgur to Imgin) [Private alternative to Imgur] must be looked in, 290, 271, 260, 251, 236, 210, 287, 101, 43, 35, 201, 194, 156, 139, 114

https://github.com/SimonBrazell/privacy-redirect/issues/___ (View the Issues by replacing ___ with the numbers for eay access) Sorry, I cannot link for that because I'm on the move.

These are the Issues I think that needs to be implemented in Libredirect. These are in No Particular Order.

Instagram redirect

Hi, would it be possible to add https://imginn.com/ as an alternative Instagram frontend? Public Bibliogram instances are not very useful because they are all rate limited and you can't go back and view old posts.

Thanks for reading

Nitter embeds

Nitter recently added embed functionality to their API. Tons of websites these days need Twitter embeds in order to be readable.

Could replacing Twitter embeds with Nitter embeds be incorporated into LibRedirect?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.