summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTails developers <amnesia@boum.org>2011-12-19 11:37:12 +0100
committerTails developers <amnesia@boum.org>2011-12-20 19:01:12 +0100
commitb524961410d8dfe77a49c2f8631b140db56d1575 (patch)
tree44ea7e0e784343da6ab346ed9ee95307cc6981de
parent432162afbbd20a1b72d870d99b6f1ee7f514e35e (diff)
Redirect users to offline copy of Tails website for warning.
-rw-r--r--content/Core/downloadOverlay.js2
-rw-r--r--content/Core/misc.js26
-rw-r--r--content/Core/overlay.js2
3 files changed, 28 insertions, 2 deletions
diff --git a/content/Core/downloadOverlay.js b/content/Core/downloadOverlay.js
index 88c15e8..89a5882 100644
--- a/content/Core/downloadOverlay.js
+++ b/content/Core/downloadOverlay.js
@@ -99,7 +99,7 @@ FireGPG.DownloadOverlay = {
*/
onDelayMenuAction: function(action) {
- FireGPG.Misc.showEditor('');
+ FireGPG.Misc.showTailsDocWarning();
},
/*
diff --git a/content/Core/misc.js b/content/Core/misc.js
index 26a5a1d..a1aba55 100644
--- a/content/Core/misc.js
+++ b/content/Core/misc.js
@@ -306,6 +306,32 @@ FireGPG.Misc = {
},
/*
+ Function: showTailsDocWarning
+
+ Opens a warning about FireGPG from the Tails documentation
+ */
+ showTailsDocWarning:function () {
+ var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
+
+ lang = prefs.getCharPref("general.useragent.locale").substring(0,2);
+ var url_prefix = "file:///usr/share/doc/tails/website/doc/encryption_and_privacy/FireGPG_susceptible_to_devastating_attacks.";
+ var url = url_prefix + lang + ".html"
+
+ try {
+ client = new XMLHttpRequest();
+ client.open("GET", url, false);
+ client.send();
+ }
+ catch (err) {
+ // file didn't exist, default to english
+ url = url_prefix + "en.html";
+ }
+
+ var window = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService(Components.interfaces.nsIWindowMediator).getMostRecentWindow('navigator:browser');
+ window.gBrowser.selectedTab = window.gBrowser.addTab(url);
+ },
+
+ /*
Function: getPassword
Show the generic dialog to get a password.
diff --git a/content/Core/overlay.js b/content/Core/overlay.js
index 9802f4f..6a3d629 100644
--- a/content/Core/overlay.js
+++ b/content/Core/overlay.js
@@ -144,7 +144,7 @@ FireGPG.Overlay = {
*/
onDelayMenuAction: function(action) {
- FireGPG.Misc.showEditor('');
+ FireGPG.Misc.showTailsDocWarning();
},
/*