• Sign in
  • Sign up
Elektrine
EN
Log in Register
Modes
Overview Chat Timeline Communities Gallery Lists Friends Email Vault DNS VPN
Back to Timeline !privacy @IndigoGollum
In reply to 1 earlier post
@hyacin@lemmy.ml on lemmy.ml Open parent
Simple external link blocking extension
I don’t know if it’s just me - I go to great lengths to keep my fedi activity separate from my other internet activity, and I get REALLY mad when I’m browsing Lemmy, click something that I assume will take me to a local discussion, and it opens some random external site - often one I’ve never even heard of - and now who knows what that site is doing, trying to do, cookies, etc., trying to link me and my referrer to my other activity (I do all my fedi stuff by VPN too, so it wouldn’t be by IP, but, they have ways) etc. etc. As I couldn’t find anything already available, I finally got off my butt and just made something to prevent it. These files can be dumped in a local folder, and then under Chrome/Opera/anything-Chromium extensions, you can ‘enable developer options’, and then ‘load unpacked’. It’s SUPER simple, and works, you just need to customize your instance hostname. I thought it might be something at least one other person in this community has thought about and fought with, so I figured I’d share it here! background.js - empty file, but required content.js - // Check if the current page is on lemmy.ml if (window.location.hostname === 'lemmy.ml') { document.querySelectorAll('a').forEach(link => { link.addEventListener('click', (event) => { const href = link.href; const currentDomain = window.location.hostname; // Check if the clicked link is not on the current domain if (new URL(href).hostname !== currentDomain) { event.preventDefault(); // Prevent default navigation const confirmation = confirm("You are about to leave lemmy.ml. Do you want to continue?"); if (confirmation) { window.open(href, '_blank'); // Open in a new tab } } }); }); } manifest.json - { "manifest_version": 3, "name": "Block External Links", "version": "1.0", "permissions": [ "tabs", "activeTab" ], "background": { "service_worker": "background.js" }, "content_scripts": [ { "matches": [""], "js": ["content.js"] } ] } Hope this is useful to someone!!
Open parent Original URL
13
1
1
0
IndigoGolem in !privacy
@IndigoGollum@lemmy.world · Mar 03
See also: Firefox tab containers (built in feature), Temporary Containers extension (makes a new temporary folder for cookies & cache every time you go to a new domain/subdomain), and uMatrix extension (block embedded anything from any source, by domain & subdomain).
View on lemmy.world
0
0
0
Sign in to interact

Loading comments...

About Community

privacy
Privacy
!privacy@lemmy.ml
A place to discuss privacy and freedom in the digital world.

Privacy has become a very important issue in modern society, with companies and governments constantly abusing their power, more and more people are waking up to the importance of digital privacy.

In this community everyone is welcome to post links and discuss topics related to privacy.

Some Rules
  • Posting a link to a website containing tracking isn’t great, if contents of the website are behind a paywall maybe copy them into the post
  • Don’t promote proprietary software
  • Try to keep things on topic
  • If you have a question, please try searching for previous discussions, maybe it has already been answered
  • Reposts are fine, but should have at least a couple of weeks in between so that the post can reach a new audience
  • Be nice :)
Related communities
  • Lemmy.ml libre_culture
  • Lemmy.ml privatelife
  • Lemmy.ml DeGoogle
  • Lemmy.ca privacy

much thanks to @gary_host_laptop for the logo design :)

48031
Members
6486
Posts
Created: November 15, 2019
View All Posts
313k7r1n3

Company

  • About
  • Contact
  • FAQ

Legal

  • Terms of Service
  • Privacy Policy
  • VPN Policy

Email Settings

IMAP: mail.elektrine.com:993

POP3: pop3.elektrine.com:995

SMTP: mail.elektrine.com:465

SSL/TLS required

Support

  • support@elektrine.com
  • Report Security Issue

Connect

Tor Hidden Service

khav7sdajxu6om3arvglevskg2vwuy7luyjcwfwg6xnkd7qtskr2vhad.onion
© 2026 Elektrine. All rights reserved. • Server: 05:20:47 UTC