[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [DDTSS] missing information about previous translation with Iceweasel and https


Le 14/01/2016 07:03, Christian PERRIER a écrit :
> Quoting Thomas Vincent (thomas@vinc-net.fr):
>> I would like to have you opinions about it and am willing to propose a
>> patch if my poor Perl skills allow me to do so. :)
> Please do!

Daniele Forsi has implemented a nice (client-side) workaround in his
greasemonkey script [1]. It simply consists in removing the scheme (the
"http:" part) from the iframe url.
Having such a url allows the browser to ask for the https page if the
main page is currently https and ask for http otherwise.

To implement that in DDTSS, I just changed the regex which fetches the
patch url for the iframe to make it leave the scheme out. See the
slightly moved parenthesis in the attached patch. :)

If nobody objects, I will push my change at the end of the week and hope
nothing breaks. :)



diff --git a/ddtss/ddtss-cgi b/ddtss/ddtss-cgi
index c5e841e..97bd1f5 100755
--- a/ddtss/ddtss-cgi
+++ b/ddtss/ddtss-cgi
@@ -1345,7 +1345,7 @@ sub display_translate_screen
 #  $long_tr =~ s/^\.\s*$//mg;
-  my ($patch) = ($data =~ m,^# patch (http://[^\s]+),m);
+  my ($patch) = ($data =~ m,^# patch http:(//[^\s]+),m);
   print $q->header(-type =>'text/html', -charset => "UTF-8");
   print $q->start_html( -title => "DDTSS ($lang): $title", -onload => 'document.forms[0].submit.disabled=1', @html_headers ),

Attachment: signature.asc
Description: OpenPGP digital signature

Reply to: