wseagar / eight-dollars

A browser extension that shows twitter blue vs real verified users
MIT License
1.19k stars 69 forks source link

[Suggestion] Userscript (Tampermonkey/Violentmonkey) version #19

Open Phosphorshy opened 1 year ago

Phosphorshy commented 1 year ago

Along with the extension versions taking script.js and slapping the userscript header allows it to work with Tampermonkey/Violentmonkey, meaning users of those don't have to install another extension to use this

(example header)

// ==UserScript==
// @name        eight-dollars
// @match       *://*.twitter.com/*
// @grant       none
// @version     1.1.0
// @author      William Seagar & Walter Lim
// @description eight-dollars can help you tell the difference between actual verified accounts and twitter blue users. Just install the extension and see the difference.
// ==/UserScript==

image image

trlkly commented 1 year ago

You could even just make that script.js, as the userscript header would not interfere with the other versions. And the userscript would get automatic updates.

SukkaW commented 1 year ago

You could even just make that script.js, as the userscript header would not interfere with the other versions. And the userscript would get automatic updates.

But you will have to inline defaultConfig from content.js into your userscript as well.

trlkly commented 1 year ago

Or set it up where it can be @required as a separate script that runs before the main script.

Proof of concept at my fork: https://github.com/trlkly/eight-dollars. Click here to install if you have TamperMonkey.

(Of course, the extension itself may not be useful as Musk keeps making changes.)

wseagar commented 1 year ago

Sorry about this one guys I had a think and just because of config issues I'd be happy for one of you guys to fork to support TamperMonkey. Mainly because I don't use it and therefore I'll likely break it with future releases.

daniel-white commented 1 year ago

It would definitely save you time on the Safari version

daniel-white commented 1 year ago

@trlkly are you able to get this to work in Safari's User Scripts extension? I'm not sure what's missing to trigger it.

trlkly commented 1 year ago

are you able to get this to work in Safari's User Scripts extension?

Unfortunately, I don't know either. I don't have access to a device running Safari with that extension. That said, I do I have a couple of ideas that might help:

  1. If the problem is just that it doesn't load it automatically, then try creating a new script and copy and paste the contents of the .user.js file into that.
  2. Try inlining the whole of my content.js, in case @require doesn't work. Remove the @require line as well.
  3. Move the if statement checking for GM_info to the top of the if statements (instead of using an else if. That way it will check for it first, and not for the chrome object first.

I went ahead and did number 3 myself. So try the script again to see if that helps. It should now check to see if it's a Userscript before checking to see if it's a Browser extension.)

trlkly commented 1 year ago

Note however that I did do this only as a proof of concept, and have no intention of updating or supporting it at this time. I just wanted to show that not much was needed to get the basics working. (Note that there is no way to change the settings in my PoC.)

trlkly commented 1 year ago

@daniel-white Did any of my suggestions ever work? I'm curious.

I went ahead and updated the script for the latest version. Again, no promises I'll keep updating, but it was easy enough.

waltzaround commented 1 year ago

will give it a look after work tomorrow - have got a few people asking for it on Arc as well

trlkly commented 1 year ago

@waltzaround: BTW, do you know what in the code causes the proper verified checkmark to appear black? For some reason, in my userscript POC, it stays blue. I had to write a workaround style to fix that.