Code Monkey home page Code Monkey logo

link-cleaner's Introduction

link-cleaner's People

Contributors

armoredcavalry avatar corbindavenport avatar jdries3 avatar

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

link-cleaner's Issues

Macy's Link

Google Play links don't work

Links like https://play.google.com/store/apps/details?id=org.videolan.vlc turn into https://play.google.com/store/apps/details.

YouTube URL issues

This URL:

https://youtube.com/shorts/lrQRJBgYot0?si=123test

Turns into this URL:

https://youtu.be/null

App doesn't work if settings are not checked at least the first time

After the changes made in commit a268656, the app is not working anymore if the setting page is not open the first time and both checkboxes are flagged (and then unflagged) the first time.

The issue is in rows 24-25 in file js/main.js: without interacting the first time with the checkboxes, getItem returns a null value and the following toLowerCase() method will fail.

link-cleaner/js/main.js

Lines 24 to 25 in a268656

var youtubeShortenEnabled = JSON.parse(localStorage.getItem('youtube-shorten-check').toLowerCase());
var fixTwitterEnabled = JSON.parse(localStorage.getItem('vxTwitter-check').toLowerCase());

The same issue should be present in file js/bulk.js on rows 8-9:

var youtubeShortenEnabled = JSON.parse(localStorage.getItem('youtube-shorten-check').toLowerCase());
var fixTwitterEnabled = JSON.parse(localStorage.getItem('vxTwitter-check').toLowerCase());

Some alerts don't work in Microsoft Edge sidebar mode

The button for "Share to Mastodon" doesn't work when Link Cleaner is running from the Edge sidebar, presumably because Edge doesn't allow browser-level alerts. Need to check for other similar alerts in the app.

Add x.com detection

I'm starting to see x.com links in more places, seemingly shared from the Twitter/X app. They're in the same format as Twitter links and redirect to the same page on twitter.com when resolved:

https://x.com/crinacle/status/1691152430493564928

https://x.com/wojespn/status/1690478468352311297?s=46&t=gEvQlnNLbU9ke0xn1kR1YA

So the FixTweet feature needs to also check for x.com posts in addition to Twitter posts.

This code uses Google Analytics?

I just spotted this in the source code:

ga('create', 'UA-59452245-10', 'auto')
ga('require', 'displayfeatures')
ga('send', 'pageview', '/')

This link cleaning tool itself uses Google Analytics, is that correct?

If so, I think I'll likely withdraw my offer to submit a PR in #1. I'm not open to supporting software which advertises a focus on privacy and simultaneously uses Google Analytics. Perhaps there's a compelling reason, or you have a difference of opinion, I'm happy to discuss, but I also want to be upfront with my opinion that the 2 things are not compatible.

Add a direct share to Telegram inside of

As Telegram has skyrocketed in use in the USA, it's my primary share choice on any thing I send.

One of my main reasons I looked for an app like this is because I use the Pixel Launcher search bar which opens the Google app to make a search.

In Android 12 and later, I could open the Recents overview menu and tap the link icon to share directly from the Google app instead of re-searching in Chrome when I wanted to send a search page link.

But the Google app tacked so much stuff it was giant URLs.

Your app kept me from needing that.

However after seeing all your other options to share directly to with, I thought I'd request a Telegram one. (and make the way so it worked universally not the old way that looks only for the specific app, as many use the Telegram PWA, desktop apps, web page, or non-Google Play versions.)

Screenshot_20221208-183744

Some amazon.com URLs not getting cleaned.

Amazon product URLs contain the product's ID, usually after the dp/. However, some Amazon URLs contain a product/ instead. Looking at shared.js, it appears that the formula on line 47 only takes into account the URLs with dp/.

current formula: var regex = /(?:\/dp\/)(\w*|\d*)/g

proposed fix 1 (includes product/): var regex =/(?:\/dp\/|\/product\/)(\w*|\d*)/g
view formula on regex101.com

proposed fix 2 var regex =/(https?:\/\/(?:www.)?amazon.com\/.*(?:dp|product)\/(\w+))/g
This formula ensured that the URL being processed is indeed from amazon.com, and not another domain.
view formula on regex101.com

Here is an example of an uncleaned URL with product/.
https://www.amazon.com/gp/product/B01JIYL57K/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1

Regardless, thank for the hard work everyone, linkcleaner.app is an amazing tool.

History feature

Feature request: "maybe you've gotten this before, but it would be cool to see a history of the recent links you cleaned. like it wouldnt need to remember them all, but maybe just for the current session"

Add option to auto copy to clipboard

Suggested here: https://twitter.com/LinkofHyrule89/status/1573131451054301185

Not all browsers support writing to the clipboard without a gesture (e.g clicking a button): w3c/clipboard-apis#182

Chromium will also soon require granting a permission before writing to the clipboard without a gesture: https://chromium.googlesource.com/chromium/src/+/10300ac7da93a7e322274f1e

Enabling the setting will probably require asking for a permission first, and only saving the setting if the permission is granted. There can also be a message above the share buttons that says if the result was successfully copied to the clipboard or not. Will need to test in Chrome Canary for future-proofing.

Extract URLs from Text

When I share a tweet in the Twitter PWA, not only the link is shared but also the content:

Corbin Davenport (@corbindavenport) Tweeted:
Check out my podcast @TechTalesShow, where me and a guest talk about wild stories in technology history, from early computers to mobile games.

YouTube: https://t.co/zCeEANnIhU

Apple: https://t.co/i5YVCpXGfG

Spotify: https://t.co/WPd90JFmQx

SoundCloud: https://t.co/uf9ii4h7Cc
https://twitter.com/corbindavenport/status/1468665663476617216?s=20&t=Cg4SWcxfa2AqONQ0lz5VLg

Unfortunately, when I then select the Link Cleaner, it does not work.

My idea:
Either URLs should be extracted from the content or the text should be kept and the links replaced with clean links in it.

The best would be a selection in the PWA, where the user can choose one of these options

Custom app install prompt

Link Cleaner should override the 'Add to home screen' prompt on Chrome (and other install banners) with a button that explains installing Link Cleaner will add the app to your device's share menu.

Ideally, the override should only happen if both installation and Web Share Target support are present in the browser. Not sure if there's a way to detect Share Target support with JS, since that's defined in the manifest.

Support l.facebook.com/l.php? cleaning

Firstly, thanks for building this, it's exactly what I was hoping I wouldn't have to build myself!

Secondly, what about adding the option to copy & paste a link from Facebook and get back the real URL? I realise that right now that doesn't work.

Here's the URL format:

https://l.facebook.com/l.php?
u=URL_ENCODED_LINK_HERE
&h=TRACKING_PARAM
&__tn__=TRACKING_PARAM
&c[0]=TRACKING_PARAM

I guess a sensible strategy would be:

  • If the link host is l.facebook.com
  • Get the u parameter from the URL
  • decodeURIComponent() on u
  • Pass the result (which includes fbclid and other junk) through the current rules

I'd be happy to work on a PR if that's something you're open to. Just let me know.

Strip shortened TikTok links to their canonical form.

When sharing links from TikTok, the app generates an unique link that is associated with your account.
For the privacy reasons of me and others I'd like an option to get rid of that.

This could be out of the scope of this project, so please don't be afraid to close the issue :)

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.