Bitcoin Forum
November 05, 2024, 02:07:14 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [Userscript] Automatically append ;dt to the end of URLs (View as DT) [v0.2.3]  (Read 401 times)
DarkStar_ (OP)
Legendary
*
Offline Offline

Activity: 2772
Merit: 3284


View Profile WWW
January 13, 2019, 04:14:03 AM
Last edit: January 13, 2019, 05:50:04 PM by DarkStar_
Merited by Vod (10), LoyceV (8), suchmoon (7), o_e_l_e_o (6), dkbit98 (3), Hhampuz (2), OgNasty (1), Welsh (1), coinlocket$ (1), The Cryptovator (1), Chivas Regal (1)
 #1

I made a basic Userscript that will automatically add ";dt" to the end of all[1] bitcointalk URLs. It basically acts as a "View as DefaultTrust" option and can be toggled in Tampermonkey.

Installation:
1. Install the Tampermonkey extension (firefox) (chrome) if it is not already installed.
2. Click here and click the "Install" button (current version: 0.2.3)

Usage:
1. Install
2. Enjoy!
3. You can disable the script by unchecking the DT Redirect box in Tampermonkey.

Source Code:
The source code can be found here.

Changelog:
Code:
v0.1.0 - Released
v0.2.0 - Changed to inject URLs with ;dt to prevent needless redirects
v0.2.1 - Adds injection where URL contains only the path
v0.2.2 - Prevents URLs containing only paths from being injected on sites other than Bitcointalk
v0.2.3 - Injects URLs with a path of both "/index.php" and "index.php"

Disclaimer:
I am not liable for any damages somehow caused by the script.


[1] Not all URLs are redirected, as some pages break when ;dt is added. Currently, links to direct messages (example) and links that lead to the newest post (example) are excluded as they do not directly lead to a specific message when ;dt is appended. Some other links are excluded as well, but adding ;dt would have no effect on those pages. If there are other pages that break, please let me know and I will exclude them from the script.

taking a break - expect delayed responses
suchmoon
Legendary
*
Offline Offline

Activity: 3850
Merit: 9072


https://bpip.org


View Profile WWW
January 13, 2019, 04:30:34 AM
 #2

Is this going to load each page twice?
DarkStar_ (OP)
Legendary
*
Offline Offline

Activity: 2772
Merit: 3284


View Profile WWW
January 13, 2019, 04:33:54 AM
 #3

Is this going to load each page twice?

Unfortunately I believe it does. I'm not sure if the first page is actually loaded, but it does redirect in the browser. The alternative would be to inject modifications to URLs, but I'm not too sure how to do it.

taking a break - expect delayed responses
suchmoon
Legendary
*
Offline Offline

Activity: 3850
Merit: 9072


https://bpip.org


View Profile WWW
January 13, 2019, 04:41:00 AM
Merited by DarkStar_ (7)
 #4

Is this going to load each page twice?

Unfortunately I believe it does. I'm not sure if the first page is actually loaded, but it does redirect in the browser. The alternative would be to inject modifications to URLs, but I'm not too sure how to do it.

Code:
document.querySelectorAll("a[href^='https://bitcointalk.org/']").forEach(a => { a.href += ";dt"; });

Well, you probably want to do more validation, e.g. if the URL already has ";dt" in it for some reason, plus your exclusions.
DarkStar_ (OP)
Legendary
*
Offline Offline

Activity: 2772
Merit: 3284


View Profile WWW
January 13, 2019, 05:21:23 AM
 #5

Is this going to load each page twice?

Unfortunately I believe it does. I'm not sure if the first page is actually loaded, but it does redirect in the browser. The alternative would be to inject modifications to URLs, but I'm not too sure how to do it.

Code:
document.querySelectorAll("a[href^='https://bitcointalk.org/']").forEach(a => { a.href += ";dt"; });

Well, you probably want to do more validation, e.g. if the URL already has ";dt" in it for some reason, plus your exclusions.

Thanks, version 0.2 injects URLs instead now.

taking a break - expect delayed responses
Chivas Regal
Member
**
Offline Offline

Activity: 88
Merit: 13

Cheers!


View Profile
January 28, 2022, 01:48:01 AM
Merited by o_e_l_e_o (4), Halab (2)
 #6

I have both a Firefox and Tor browser on my PC.  Firefox already had Greasemonkey installed but neither had Tampermonkey.

While reading the page just now (on Tor and without it occurring to me that neither Grease or Tamper were installed) I clicked on the js link shows the code, however (as you would expect) did not install.

I went over to Firefox and clicked install and was able to, then discovering I'd done so via GreaseMonkey.  I went back and installed Tampermonkey on Firefox and was also able to install the js code to Tamper on Firefox.

Unfortunately, I don't seem to be able to install either Greasemonkey or Tampermonkey on my PC Tor, so I guess I'm wondering if you can help with how I might do this?

I've also discovered there is something called Tor Alpha for Android - I already have both Firefox and Tor on my Android device, however, I'm just wondering should I migrate to Tor Alpha?  And, how do I install grease monkey and or Tampermonkey on the various Tor instances that I have?

Thanks.

Pleased to meet you.
owlcatz
Legendary
*
Offline Offline

Activity: 3808
Merit: 1974


https://talkimg.com - Fck Imgur/BBwhatever


View Profile WWW
January 28, 2022, 03:41:42 AM
 #7

You can just append ;dt to any bitcointalk.org url now and it will work. no plugin/script needed, theymos made that change a while back... HTH

EDIT - I have the DT redirect script installed, and I haven't had it running in a long time so can't help ya there sorry! 🤷‍♂️

.
I  C  Λ  R  U  S
██████████
██████▀▀▀██
████▀█████▀█
██████████
██████████
█████████████
░▄████
█████████████
███████████████████
███████████████████
████████░░░▀▀▀▀▀▀▀▀
████████▄▄▄████████
███████████████████
█████████████████▀
░░░██
▄▄▄█
█████
░░░██
░░░██
░░░██
░░░██
░░░
░░░
░░░
▄██████
█▌░▐██
███████▀
█████████████████████
██
███████████████████
██
███████████████████
██
████▀▀▀▀████▀▀█████
██
██░░▄▄░░██░░░█████
██
███▄▄██░░███░░█████
██
███▀▀▀▀░░▀██░░█████
██
██░░░░▄▄▄▄█▀░░▀████
██
██░░░░░░░░█░▀▀░████
██
███████████████████
██
███████████████████
██
███████████████████
█████████████████████
████
██
██
██
██

██
██
██
██
██
██
██
████
████
██
██
██
██

██
██
██
██
██
██
██
████
████
██
██
██
██

██
██
██
██
██
██
██
████
████
██









██
████
████
██









██
████
[/ce
o_e_l_e_o
In memoriam
Legendary
*
Offline Offline

Activity: 2268
Merit: 18726


View Profile
January 28, 2022, 11:59:52 AM
Merited by ibminer (2), Chivas Regal (1)
 #8

Unfortunately, I don't seem to be able to install either Greasemonkey or Tampermonkey on my PC Tor, so I guess I'm wondering if you can help with how I might do this?
I just tried and it works absolutely fine for me.

  • Open Tor
  • Go to Options menu -> Add-ons and themes
  • Search for Tampermonkey and install
  • Allow Tampermonkey to Run in Private Windows
  • Come back here and use the install link in DarkStar_'s post

Why is it not working for you? What step(s) is/are giving you problem(s)?

Note of course that every additional extension you install in Tor reduces both your security and your privacy, so you really shouldn't be doing this unless you really find it necessary.

I've also discovered there is something called Tor Alpha for Android - I already have both Firefox and Tor on my Android device, however, I'm just wondering should I migrate to Tor Alpha?
Tor Alpha is exactly what it sounds like - the alpha (very early) release of the latest versions for testing and bug squashing reasons. You definitely shouldn't be using it as a main browser.
Chivas Regal
Member
**
Offline Offline

Activity: 88
Merit: 13

Cheers!


View Profile
January 29, 2022, 04:19:28 AM
 #9

Unfortunately, I don't seem to be able to install either Greasemonkey or Tampermonkey on my PC Tor, so I guess I'm wondering if you can help with how I might do this?
I just tried and it works absolutely fine for me.

  • Open Tor
  • Go to Options menu -> Add-ons and themes
  • Search for Tampermonkey and install
  • Allow Tampermonkey to Run in Private Windows
  • Come back here and use the install link in DarkStar_'s post

Why is it not working for you? What step(s) is/are giving you problem(s)?

TBH I'm not really sure where it failed.  I have both grase and Tamper seemingly installed, however, they never came up with confirmation or install Darkstars_ code.

In the end, I toggled the "Allow Tampermonkey to Run in Private Windows" on and off three or four times on and off and a page popped up to say Tamper had been installed.  The same thing happened with Grease monkey.

Quote
I've also discovered there is something called Tor Alpha for Android - I already have both Firefox and Tor on my Android device, however, I'm just wondering should I migrate to Tor Alpha?
Tor Alpha is exactly what it sounds like - the alpha (very early) release of the latest versions for testing and bug squashing reasons. You definitely shouldn't be using it as a main browser.

I was wondering about that with the Alpha, I might have a play with that instance trying to get tamper installed on the Android Device - unlike the PC version, the Android one seems determined *not* to install even when I put https://addons.mozilla.org/en-GB/firefox/addon/tampermonkey/ in the Tor browser window, downloaded the file and tried to open in the browser from there.

Quote
Note of course that every additional extension you install in Tor reduces both your security and your privacy, so you really shouldn't be doing this unless you really find it necessary.

I was actually searching for something else that might mark a thread as "read" if the last post contains *just* the word "bump" and stumbled upon this post, so I thought I'd give it a go and see.

Looks like some sections don't do the ;dt thing, but it seems to be holding.

Thanks guys, I appreciate your help.

Pleased to meet you.
o_e_l_e_o
In memoriam
Legendary
*
Offline Offline

Activity: 2268
Merit: 18726


View Profile
January 29, 2022, 11:35:54 AM
 #10

In the end, I toggled the "Allow Tampermonkey to Run in Private Windows" on and off three or four times on and off and a page popped up to say Tamper had been installed.  The same thing happened with Grease monkey.
Every Tor window is private by default. If the extension is refused permission to run in private windows, then it will not run.

I was wondering about that with the Alpha, I might have a play with that instance trying to get tamper installed on the Android Device - unlike the PC version, the Android one seems determined *not* to install even when I put https://addons.mozilla.org/en-GB/firefox/addon/tampermonkey/ in the Tor browser window, downloaded the file and tried to open in the browser from there.
You'll never get it installed to Tor on Android. Tor is a modified version of Firefox, which removed support for most mobile extensions a few years ago (and have disappointingly not re-implemented support despite promising to do so a long time ago). There is a work around for this you can use by using the alpha version of Firefox (but again, you have to accept all the additional risks which come with using alpha software), but this work around does not work on either Tor nor Tor Alpha. You are wasting your time trying.

And again, you really should think twice about all of this: https://support.torproject.org/tbb/tbb-14/
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!