Skip to content

Commit 0239994

Browse files
committed
Remove Enable / Disable rules window.
Loading all the rulesets at once for the Enable / Disable rules window causes browser lockup and sometimes crashes. All of the functionality in the window is now available in other places: Rules can be enabled and disabled directly from the drop down menu. "Disable all" is available as the menu item "Disable HTTPS Everywhere." And viewing the source of rulesets is available through the HTTPS Everywhere Atlas. The one missing piece of functionality was "Reset rulesets to defaults," which I moved to a menu item. Now, the preferences link in Firefox's Add-On pane will take you to the SSL Observatory preferences.
1 parent dac336f commit 0239994

10 files changed

Lines changed: 32 additions & 362 deletions

File tree

https-everywhere-tests/README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ implement them as automated tests:
2626
ruleset is disabled.
2727
- Click HTTP Everywhere icon, click ruleset again.
2828
- Reopen HTTPS Everywhere icon menu, verify ruleset shows up in green.
29-
- Click HTTPS Everywhere icon menu, click 'Enable / disable rules'. This will
30-
freeze up the browser for a few seconds. Verify it eventually opens up a
31-
dialog box listing all rules.
3229
- Right-click on a rule, click 'View XML source.' Verify it opens up a dialog
3330
box and shows the rule source.
3431
- Click HTTPS Everywhere icon menu, click 'Block all HTTP requests'. Verify icon

src/chrome/content/about.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const CC = Components.classes;
2+
3+
function window_opener(uri) {
4+
// we don't use window.open, because we need to work around TorButton's state control
5+
if(typeof gBrowser == "undefined"){
6+
var window = CC["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator);
7+
var browserWindow = window.getMostRecentWindow("navigator:browser").getBrowser();
8+
var newTab = browserWindow.addTab(uri, null, null);
9+
browserWindow.selectedTab = newTab;
10+
11+
}
12+
else
13+
gBrowser.selectedTab = gBrowser.addTab(uri);
14+
}

src/chrome/content/about.xul

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
align="center">
1515

1616
<script type="application/x-javascript"
17-
src="chrome://https-everywhere/content/preferences.js"/>
17+
src="chrome://https-everywhere/content/about.js"/>
1818
<vbox style="overflow:auto" flex="1">
1919
<label style="text-align:center; font-weight:bold; font-size:22px;">&https-everywhere.about.ext_name;</label>
2020
<label style="text-align:center; font-size:18px; margin-bottom:10px;">&https-everywhere.about.ext_description;</label>

src/chrome/content/code/ApplicableList.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,20 +98,21 @@ ApplicableList.prototype = {
9898
var text = strings.getString("https-everywhere.menu.globalDisable");
9999
if(!https_everywhere.prefs.getBoolPref("globalEnabled"))
100100
text = strings.getString("https-everywhere.menu.globalEnable");
101-
101+
102102
enableLabel.setAttribute('label', text);
103-
enableLabel.setAttribute('command', 'https-everywhere-menuitem-globalEnableToggle');
103+
enableLabel.setAttribute('command', 'https-everywhere-menuitem-globalEnableToggle');
104104
this.prepend_child(enableLabel);
105-
105+
106106
// add the label at the top
107107
var any_rules = false;
108108
for(var x in this.all) {
109109
any_rules = true; // how did JavaScript get this ugly?
110110
break;
111111
}
112+
// This label just describes the fact that the items underneath it enable
113+
// and disable rules.
112114
var label = document.createElement('menuitem');
113115
label.setAttribute('label', strings.getString('https-everywhere.menu.enableDisable'));
114-
label.setAttribute('command', 'https-everywhere-menuitem-preferences');
115116
var label2 = false;
116117
if (!any_rules) {
117118
label2 = document.createElement('menuitem');

src/chrome/content/preferences.css

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/chrome/content/preferences.js

Lines changed: 0 additions & 278 deletions
This file was deleted.

0 commit comments

Comments
 (0)