Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use prefs.js to get installed torbrowser version #308

Closed
wants to merge 1 commit into from

Conversation

nickjwhite
Copy link

Browser/TorBrowser/Docs/sources/versions is no longer provided by
TorBrowser, so get the current version string from prefs.js instead.

This fixes issue #306.

Described in https://trac.torproject.org/projects/tor/ticket/25012#comment:8 as "a more robust kludge" than reading Changelog.txt :p

Browser/TorBrowser/Docs/sources/versions is no longer provided by
TorBrowser, so get the current version string from prefs.js instead.

This fixes issue torproject#306.
@aagbsn
Copy link

aagbsn commented Jan 25, 2018

From IRC (OFTC, #tor-dev) discussion:

< aagbsn> is parsing prefs.js the ugly workaround? it looks like someone has a PR on github.com/micaflee/torbrowser-launcher/pull/308
< aagbsn> er that link is bad. sorry. from another device. should be github.com/micahflee/torbrowser-launcher/pull/308
<+sysrqb> aagbsn: prefs.js is a temp file generated when firefox loads based on the current browser prefs 
<+sysrqb> it's not really intended for specifying a version number,
< aagbsn> oh catch 22
< aagbsn> if tbb hasn't launched, it doesn't exist?
<+sysrqb> hmm, let me check a fresh tar.gz
<+sysrqb> yeah, nope
<+sysrqb> this is what the header of prefs.js says, btw:
<+sysrqb>  *
<+sysrqb>  * If you make changes to this file while the application is running,
<+sysrqb>  * the changes will be overwritten when the application exits.
<+sysrqb>  *
<+sysrqb>  * To make a manual change to preferences, you can visit the URL about:config
<+sysrqb>  */
< aagbsn> bummer scene 
< boklm> so the patch reading the version from the ChangeLog file looks better (although it can still be broken easily in a future version, but 
         should fix the issue for now)
<+sysrqb> okay, but it is saved across loads 
<+sysrqb> (prefs.js)
<+sysrqb> so torbrowser-launcher may get a stale vers from prefs.js, sbut it should work as long as TB was previously launched
<+sysrqb> the ChangeLog seems slightly better, because it's a fixed file
<+sysrqb> but there aren't any guarantees about the format of that, either
<+sysrqb> so *shrug*
<+sysrqb> i guess they'll do whatever is the easiest fix
< aagbsn> do you mind if I paste the above comments on the github PR?
< boklm> with the prefs.js patch, torlauncher will try to load this file before running torbrowser for the first time, so it won't work
< intrigeri> long term, I guess the TB build process should ideally create a metadata file about itself. similar to /etc/os-release, what Tails 
             has in /etc/amnesia/version, etc.
<+sysrqb> aagbsn: nope, go for it
<+sysrqb> intrigeri: yeah (i'm not sure if you saw yawning created #25020 )
-zwiebelbot:#tor-dev- tor#25020: There should be an easy way to detect the version of an installed bundle. - [new] - 
    https://bugs.torproject.org/25020
< aagbsn> boklm, intrigeri ok also? 
< intrigeri> aagbsn: yep.

@nickjwhite
Copy link
Author

Thanks @aagbsn for posting that, I should have tested more thoroughly; I presumed that the default prefs.js was part of the shipped tarball. I'll close this pull request in favour of #307.

@nickjwhite nickjwhite closed this Jan 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants