Re: [Tails-dev] Verification extension [was: HTML prototype …

Delete this message

Reply to this message
Autore: Uzair Farooq
Data:  
To: sajolida
CC: Muhammad Usman Subhani, The Tails public development discussion list
Oggetto: Re: [Tails-dev] Verification extension [was: HTML prototype for new download page]
> It works when the version of the extension is up-to-date (1.0 or 1.1) but
it doesn't work when the version is outdated (0.9). I can see that
data-extension
is still set to "ok". See screenshot.

We have fixed an error with version checking so it should work now. Still
if you want us to shift to simple floats comparison, we can do that.

To test locally just need to change background.js, line 3
from: let matches = "://tails.boum.org/";
To: let matches = "file:///home/amnesia/Persistent/Tor%20Browser/
master/install/download_2.html";

On Wed, Nov 8, 2017 at 12:11 AM, sajolida <sajolida@???> wrote:

> Uzair Farooq:
> >> * Test that it works for you on https://tails.boum.org/
> install/download_2/
> > .
> >
> > This does not work for us either. Reason because no element with id
> > 'download-and-verify' is present on the page. You will have to assign
> this
> > id to some element to make it work.
>
> I also realized that shortly after I gave up yesterday night :)
>
> So I pushed 7b5ec02933 on the production website and it's working now.
>
> >> * I see that you changed some condition in scripts/background
> > /background.js, is it still supposed to work when I try from
> > a local build of the website. On my Tails, I'm checking
> >
> > We have only whitelisted 'tails.boum.org' so it'll only work on this
> site.
> > If we add any other domains, it'll ask user for permission to those sites
> > as well during installation.
>
> Ok, so let's not do that...
>
> But then it very painful to work on the code, test, and debug because
> I'm pushing new versions on the production website every time. I know
> how to edit HTML and CSS through the Firefox developer tools but I don't
> know how to do something similar for the JavaScript on the page.
>
> How do you test your changes to dave_2.js locally?
>
> >> Uzair Farooq:
> >>> 1. We are now logging percentage to console, you can replace it with a
> >>> progress bar. Please have a look at the commit: https://github.com/
> >>> usman-subhani/Tails-repos/commit/bfb204b3c006189094c23626acab0d
> >>> b1daf99109. The console.log(percentage) line is executed whenever
> there's a change in
> >>> percentage.
>
> I wired that into the HTML page and it's working. Cooool!
>
> >>> 2. We now update the $FILENAME with actual filename.
>
> This works great! I updated a bit the HTML to avoid hard coding an
> English string in the JavaScript code (9dd2fe1a31).
>
> >>> 3. We have ported the version update logic from original extension i.e.
> >>> it will find element with id '#extension-version' on page and will
> compare
> >>> its text with installed version of extension and will set `document.
> >>> documentElement.dataset.extension` accordingly (either 'ok' or 'old').
>
> I wired this logic into the CSS (73cec4b28c).
>
> It works when the version of the extension is up-to-date (1.0 or 1.1)
> but it doesn't work when the version is outdated (0.9). I can see that
> data-extension is still set to "ok". See screenshot.
>
> Can you check what's wrong here?
>
> I see that you ported the code from Giorgio in your extension but that
> it involves quite complex string parsing, so instead of struggling with
> it, I think it would be fine if you prefer replacing it with comparing
> two floating point numbers. We don't need a very evolved version scheme
> for the extension.
>
> Also, I initially tried to the display logic in dave_2.js since it's
> where we already have all the rest but I didn't know how to do that
> (249e6f2153). Do you know if that would be possible? But it's working
> now (at least for up-to-date version) so we shouldn't spend too much
> time on that; it might just ease a bit maintenance in the future.
>
> >>> 4. We have removed the icon. Note that Chrome still shows a greyed out
> >>> icon by default and user can hide the icon themselves if they want but
> >>> extension cannot hide it.
>
> Good!
>
> >>> 5. Yeah, the extension is ready for chrome too. To install, follow the
> >>> procedure here https://developer.chrome.com/
> >>> extensions/getstarted#unpacked
>
> Wow, it works!!!
>
> >>> 6. We have changed the logic to run the extension on all web pages of
> >>> tails.boum.org which have an element with id 'download-and-verify'
> >>> present in DOM
>
> Adjusted the download page accordingly and it works.
>
> We're almost there! Now I'll investigate how to upload to the Firefox
> and Chrome stores would work and if I can do that myself.
>