Skip to content

Commit 4b9e30b

Browse files
committed
Add features to downgrade-to-stable popup
1 parent cebd184 commit 4b9e30b

File tree

6 files changed

+75
-4
lines changed

6 files changed

+75
-4
lines changed

src/chrome/content/dev-popup.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
const CI = Components.interfaces;
2+
const CC = Components.classes;
3+
4+
// LOG LEVELS ---
5+
VERB=1;
6+
DBUG=2;
7+
INFO=3;
8+
NOTE=4;
9+
WARN=5;
10+
11+
HTTPSEverywhere = CC["@eff.org/https-everywhere;1"]
12+
.getService(Components.interfaces.nsISupports)
13+
.wrappedJSObject;
14+
15+
function dev_popup_done() {
16+
// HTTPSEverywhere.prefs.setBoolPref("dev_popup_shown", true);
17+
window.close();
18+
}
19+
20+
function download_stable() {
21+
try {
22+
HTTPSEverywhere.tab_opener("https://www.eff.org/files/https-everywhere-latest.xpi");
23+
} catch(e) {
24+
alert("OOPS! Automatic download failed; please go to https://www.eff.org/https-everywhere instead.");
25+
}
26+
}

src/chrome/content/dev-popup.xul

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
3+
<!DOCTYPE window SYSTEM "chrome://https-everywhere/locale/https-everywhere.dtd">
4+
<window id="dev-popup-dialog"
5+
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
6+
xmlns:html="http://www.w3.org/1999/xhtml"
7+
title="&https-everywhere.popup.title;"
8+
width="500"
9+
height="440"
10+
align="center"
11+
onload="document.getElementById('keep-on-dev').focus()"
12+
>
13+
<image src="chrome://https-everywhere/skin/https-everywhere-banner.jpg" />
14+
<script type="application/x-javascript" src="dev-popup.js" />
15+
<label style="padding:25px;">&https-everywhere.popup.header;</label>
16+
17+
<commandgroup>
18+
<command id="revert" oncommand="download_stable(); dev_popup_done()" />
19+
<command id="keep" oncommand="dev_popup_done()" />
20+
</commandgroup>
21+
22+
<vbox flex="1">
23+
<separator class="thin"/>
24+
<label>&https-everywhere.popup.paragraph1;</label>
25+
<separator class="thin"/>
26+
<label>&https-everywhere.popup.paragraph2;</label>
27+
<spacer flex="1" />
28+
<button id="revert-to-stable" label="&https-everywhere.popup.revert;"
29+
tabindex="2"
30+
accesskey="N"
31+
command='revert' />
32+
<spacer flex="1" />
33+
<label>&https-everywhere.popup.paragraph3;</label>
34+
<separator class="thin"/>
35+
<button id="keep-on-dev" label="&https-everywhere.popup.keep;"
36+
tabindex="1"
37+
accesskey="y"
38+
command='keep'/>
39+
</vbox>
40+
</window>

src/chrome/content/observatory-popup.xul

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
<command id="more-info"
2222
oncommand='popup_done() ;
2323
window.open("chrome://https-everywhere/content/observatory-preferences.xul","obsprefs",
24-
"chrome, centerscreen")'
25-
/>
24+
"chrome, centerscreen")'/>
2625
</commandgroup>
2726

2827
<vbox flex="1">

src/chrome/locale/en/https-everywhere.dtd

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,10 @@
3535
<!ENTITY https-everywhere.source.unable_to_download "Unable to download source.">
3636

3737

38+
<!ENTITY https-everywhere.popup.title "HTTPS Everywhere 4.0development.11 notification">
39+
<!ENTITY https-everywhere.popup.header "Would you like to download the stable version of HTTPS Everywhere?">
40+
<!ENTITY https-everywhere.popup.paragraph1 "Oops. It appears that you were recently using the stable version of HTTPS Everywhere and are now on the development version. Perhaps we accidentally upgraded you to our development channel in our last release. However, we'd love it if you continued using our development release and helped us make HTTPS Everywhere better! You might find there are a few more bugs here and there, which you can report to https-everywhere@eff.org.">
41+
<!ENTITY https-everywhere.popup.paragraph2 "If you would like to return to the stable channel, click below to download our latest stable version:">
42+
<!ENTITY https-everywhere.popup.paragraph3 "Sorry about the inconvenience, and thank you for using HTTPS Everywhere.">
43+
<!ENTITY https-everywhere.popup.keep "Keep me on the development version.">
44+
<!ENTITY https-everywhere.popup.revert "Download the latest stable release.">
19.7 KB
Loading

src/components/https-everywhere.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -546,8 +546,7 @@ HTTPSEverywhere.prototype = {
546546
was_stable = false;
547547
}
548548
if (was_stable && !shown) {
549-
this.prefs.setBoolPref("dev_popup_shown", true);
550-
this.tab_opener("chrome://https-everywhere/content/observatory-popup.xul");
549+
this.tab_opener("chrome://https-everywhere/content/dev-popup.xul");
551550
}
552551
},
553552

0 commit comments

Comments
 (0)