theAlinP / twitter-link-deobfuscator

A Firefox add-on that restores the original destination of the links (from tweets) that have been shortened by the Twitter servers. It only runs while browsing Twitter's website (twitter.com).
https://addons.mozilla.org/en-US/firefox/addon/twitter-link-deobfuscator/
MIT License
36 stars 5 forks source link

Addon doesn't clean links #12

Closed asder216 closed 4 years ago

asder216 commented 4 years ago

Twitter broke the addon again :v

theAlinP commented 4 years ago

That's right. I'll see what I can do about it.

theAlinP commented 4 years ago

A strange thing happened. As I was updating the add-on I discovered that it works again.

Check it again and tell me if it works in your browser.

asder216 commented 4 years ago

It doesn't seem to work unfortunately, even by trying on a new profile.

theAlinP commented 4 years ago

Yes, it stopped functioning again. It was working fine a few hours ago.

My guess is that the developers working at Twitter are updating the site and they are testing the new features intermittently, just like they did with the new layout.

theAlinP commented 4 years ago

OK, it looks like the fault was all mine. The bug was introduced in a previous commit. The add-on failed to store a setting correctly in the browser storage when it was installed for the first time. That would explain why it didn't work after you installed it from a new profile.

Please update the add-on and tell me if it works properly.

Have you reinstalled it or disabled/enabled it from the Add-ons Manager recently, before you noticed that it stopped working?

asder216 commented 4 years ago

Yes, yes, I did a Firefox reinstall recently. Anyway I did update but it still doesn't work :v even in a new profile.

theAlinP commented 4 years ago

Well, I definitely fixed something. I tested the add-on in different browser versions from Linux and Windows and it was working fine.

Maybe I didn't fix the right bug. Or maybe it has something to do with your browser. Tell me what browser version and OS are you using.

asder216 commented 4 years ago

I have Firefox 79.0 64 bit and Windows 10 Pro 1909

theAlinP commented 4 years ago

I tested the add-on in Firefox 79.0, but on my main OS, which is Linux. I don't have Windows 10 Pro installed. One solution is to download a virtual machine and use that. Microsoft provides virtual machines but the one containing Windows 10 might have Windows 10 Enterprise inside, according to the release notes. If that's true, I can't guarantee that I can replicate the problem you're having. I'm not willing to install Win10 Pro from scratch because that would take hours.

Before I try that, can you create new profiles and install older versions of the add-on? If you find a version that works I might determine the cause. Do you know how to create a new profile manually?

asder216 commented 4 years ago

I discovered the addon doesn't work only when I'm logged in, if I try to see tweets or profile pages while logged out, with or without a new profile, it cleans all the links. I also tried that Windows VM and I can reproduce the same issue on there too.

The newest version that works for me while being logged in is 0.8.0 but only if I refresh the pages, it doesn't detect new links while scrolling or clicking on a tweet.

theAlinP commented 4 years ago

That's good to know. I will download the VM and debug the add-on inside it. I will inform you of anything I find, probably tomorrow.

asder216 commented 4 years ago

Just tried creating a new account and it works! I guess it could be an A/B test from twitter?

theAlinP commented 4 years ago

Probably. I will keep the issue open for a week or two. Let me know if it happens again.

theAlinP commented 4 years ago

It appears that the Twitter developers changed the page again and the add-on doesn't work. Can you confirm this?

I'm about to release a new version with the fix.

asder216 commented 4 years ago

The fix doesn't seem to work for me but I just tried to restore the selector to get the links to the previous one and now it works!

theAlinP commented 4 years ago

Ah, yes. I changed that selector because, for a while, the Twitter developers stopped adding titles to the elements and I started selecting them using the class name "r-1n1174f".

Are you telling me that the add-on can't find the links using the class name? In my browser the links still have that class applied to them and the add-on works with that selector.

theAlinP commented 4 years ago

Hi there, @spodermenpls! I take it that you noticed the add-on stopped working and it is working fine now, right?

asder216 commented 4 years ago

Ah, yes. I changed that selector because, for a while, the Twitter developers stopped adding titles to the elements and I started selecting them using the class name "r-1n1174f".

Are you telling me that the add-on can't find the links using the class name? In my browser the links still have that class applied to them and the add-on works with that selector.

No, my twitter doesn't seem to have that class name: immagine

spodermenpls commented 4 years ago

@theAlinP I noticed the changes made to the Twitter UI (e.g. the "sliding" effects), and can confirm it works normal again. I didn't notice TLD not working though, since I didn't use/hover over external links in the short time frame between UI change and AMO hotfix.

theAlinP commented 4 years ago

@asder216 Don't the links have that class name? You need to right-click on a link and select "Inspect Element".

Look for "r-1n1174f" inside the "class" attribute. Take a look at this: <a href="https://upworthy.com/data-privacy" target="_blank" dir="ltr" role="link" data-focusable="true" class="r-1n1174f r-1loqt21 r-1qd0xha r-ad9z0x r-bcqeeo r-qvutc0 css-4rbku5 css-18t94o4 css-901oao css-16my406" rel=" noopener noreferrer" title="https://www.upworthy.com/data-privacy" data-shortened-url="https://t.co/NE6uKMo00f?amp=1"><span aria-hidden="true" class="css-901oao css-16my406 r-1qd0xha r-hiw28u r-ad9z0x r-bcqeeo r-qvutc0">https://</span>upworthy.com/data-privacy</a>

asder216 commented 4 years ago

I tried on a few links but I don't have that unfortunately. Example: <a href="https://t.co/vB2qRqa6Ld?amp=1" target="_blank" dir="ltr" role="link" data-focusable="true" class="r-xfsgu1 r-1loqt21 r-1qd0xha r-ad9z0x r-bcqeeo r-qvutc0 css-4rbku5 css-18t94o4 css-901oao css-16my406" rel=" noopener noreferrer" title="https://www.nytimes.com/2020/08/05/arts/design/bronx-virtual-tour.html"><span aria-hidden="true" class="css-901oao css-16my406 r-1qd0xha r-hiw28u r-ad9z0x r-bcqeeo r-qvutc0">https://</span>nytimes.com/2020/08/05/art<span aria-hidden="true" class="css-901oao css-16my406 r-1qd0xha r-hiw28u r-ad9z0x r-bcqeeo r-qvutc0">s/design/bronx-virtual-tour.html</span><span aria-hidden="true" class="css-901oao css-16my406 r-1qd0xha r-ad9z0x r-bcqeeo r-lrvibr r-qvutc0">…</span></a>

theAlinP commented 4 years ago

I see. I think you are being shown a different UI. I will update the add-on to use the title attributes and fall back to using class names. You may have to wait until tomorrow, I'm afraid.

asder216 commented 4 years ago

Thanks!

theAlinP commented 4 years ago

I updated the add-on. Please update it through the Add-on Manager and tell me if it works.

asder216 commented 4 years ago

Yes, it works! Thank you very much for your help!

theAlinP commented 4 years ago

You're welcome.