Skip to content

Script that will block opening a new tab or exiting Twitter if a video with link is clicked.

License

Notifications You must be signed in to change notification settings

josencarnacao/Twitter-Block-Video-Links

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

On Twitter some accounts have videos with links that are activated if you click on the image rather than on the controls.

That missaction may lead you involuntarily onto dubious websites, some just Ads, others that might be harmful.

—————————— —————————— —————————— —————————— ——————————

I went to Bing and using CoPilot by Microsoft I made the querie:

— Make me a Tampermonkey script that will block opening a new tab or exiting Twitter if a video with link is clicked.

And it spewed:

Sure, here’s a basic Tampermonkey script that should prevent opening a new tab when clicking on a video link on Twitter. This script works by intercepting click events on video elements and preventing their default action.

Please note that this script might not work perfectly for all video links, especially if Twitter changes its website structure or if the videos are embedded in a different way. Always test scripts in a safe environment before using them regularly.

// Look for the code inside the [ Twitter Block Video Links v0.1.js ] file

AI-generated code. Please review and use carefully. Learn more about the FAQ. Remember to install this script through your Tampermonkey dashboard, and ensure that Tampermonkey is enabled when you want this functionality. Let me know if you need help with anything else! 😊

—————————— —————————— —————————— —————————— ——————————

Imagine that. It works just fine on 2024-05-25

About

Script that will block opening a new tab or exiting Twitter if a video with link is clicked.

Resources

License

Stars

Watchers

Forks

Packages

No packages published