Skip to content

Commit f634f10

Browse files
committed
Remove pre FF20 private browsing compatibility code
Since Firefox ESR's version is well above version 20 and the minimum Firefox version for Vimperator is 27, it's time to remove old per-browser based private browsing related compatibility code.
1 parent 9e519de commit f634f10

File tree

4 files changed

+1
-71
lines changed

4 files changed

+1
-71
lines changed

common/content/browser.js

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -52,47 +52,6 @@ const Browser = Module("browser", {
5252
completer: function (context) completion.charset(context)
5353
});
5454

55-
// only available in FF 3.5-19
56-
// TODO: remove when FF ESR's version is over 20. privateBrowsing will be per-window from FF 20+
57-
// XXX: on Fx20, nsIPrivateBrowsingService exists yet but has no properties
58-
let pb = services.get("privateBrowsing");
59-
if (pb && "privateBrowsingEnabled" in pb) {
60-
options.add(["private", "pornmode"],
61-
"Set the 'private browsing' option",
62-
"boolean", false,
63-
{
64-
setter: function (value) services.get("privateBrowsing").privateBrowsingEnabled = value,
65-
getter: function () services.get("privateBrowsing").privateBrowsingEnabled
66-
});
67-
let services = modules.services; // Storage objects are global to all windows, 'modules' isn't.
68-
storage.newObject("private-mode", function () {
69-
({
70-
init: function () {
71-
services.get("obs").addObserver(this, "private-browsing", false);
72-
services.get("obs").addObserver(this, "quit-application", false);
73-
this.private = services.get("privateBrowsing").privateBrowsingEnabled;
74-
},
75-
observe: function (subject, topic, data) {
76-
if (topic == "private-browsing") {
77-
if (data == "enter")
78-
storage.privateMode = true;
79-
else if (data == "exit")
80-
storage.privateMode = false;
81-
storage.fireEvent("private-mode", "change", storage.privateMode);
82-
}
83-
else if (topic == "quit-application") {
84-
services.get("obs").removeObserver(this, "quit-application");
85-
services.get("obs").removeObserver(this, "private-browsing");
86-
}
87-
}
88-
}).init();
89-
}, { store: false });
90-
storage.addObserver("private-mode",
91-
function (key, event, value) {
92-
autocommands.trigger("PrivateMode", { state: value });
93-
}, window);
94-
}
95-
9655
options.add(["urlseparator"],
9756
"Set the separator regex used to separate multiple URL args",
9857
"string", ",\\s");

common/content/services.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@ const Services = Module("services", {
4242
class_: "@mozilla.org/browser/nav-history-service;1",
4343
iface: [Ci.nsINavHistoryService, Ci.nsIBrowserHistory]
4444
},
45-
"privateBrowsing": {
46-
class_: "@mozilla.org/privatebrowsing;1",
47-
iface: Ci.nsIPrivateBrowsingService
48-
},
4945
"profile": {
5046
class_: "@mozilla.org/toolkit/profile-service;1",
5147
iface: Ci.nsIToolkitProfileService

common/locale/en-US/options.xml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -640,23 +640,6 @@
640640
</item>
641641

642642

643-
<item>
644-
<tags>'noprivate' 'private'</tags>
645-
<spec>'private'</spec>
646-
<type>boolean</type>
647-
<default>off</default>
648-
<description>
649-
<p>
650-
Set the <str>private browsing</str> option. In private browsing mode
651-
history, cache files, cookies, form data, passwords, download list
652-
entries, local and URL marks, command-line history and macros are
653-
available only for the duration of the private browsing session and
654-
deleted when returning to normal browsing mode.
655-
</p>
656-
</description>
657-
</item>
658-
659-
660643
<item>
661644
<tags>'nohls' 'nohlsearch'</tags>
662645
<tags>'hls' 'hlsearch'</tags>

common/modules/storage.jsm

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ function loadPref(name, store, type) {
151151
}
152152

153153
function savePref(obj) {
154-
if (obj.privateData && storage.privateMode)
154+
if (obj.privateData)
155155
return;
156156
if (obj.store && storage.infoPath)
157157
writeFile(getFile(obj.name), obj.serial);
@@ -357,14 +357,6 @@ var storage = {
357357
savePref(obj);
358358
},
359359

360-
_privateMode: false,
361-
get privateMode() this._privateMode,
362-
set privateMode(val) {
363-
if (!val && this._privateMode)
364-
for (let key in keys)
365-
this.load(key);
366-
return this._privateMode = Boolean(val);
367-
}
368360
};
369361

370362
// vim: set fdm=marker sw=4 sts=4 et ft=javascript:

0 commit comments

Comments
 (0)