Author

Topic: [Userscript] Automatically append ;dt to the end of URLs (View as DT) [v0.2.3] (Read 404 times)

legendary
Activity: 2268
Merit: 18748
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/
member
Activity: 88
Merit: 13
Cheers!
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.

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.
legendary
Activity: 2268
Merit: 18748
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.
legendary
Activity: 3570
Merit: 1959
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! 🤷‍♂️
member
Activity: 88
Merit: 13
Cheers!
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.
legendary
Activity: 2772
Merit: 3284
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.
legendary
Activity: 3654
Merit: 8909
https://bpip.org
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.
legendary
Activity: 2772
Merit: 3284
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.
legendary
Activity: 3654
Merit: 8909
https://bpip.org
Is this going to load each page twice?
legendary
Activity: 2772
Merit: 3284
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.
Jump to: