mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-01 12:12:28 +01:00
Don't save storage objects while in private mode, restore them on exit.
This commit is contained in:
@@ -79,10 +79,10 @@ function Bookmarks() //{{{
|
||||
].filter(function (item) item[1]));
|
||||
|
||||
const storage = modules.storage;
|
||||
function Cache(name, store, serial)
|
||||
function Cache(name, store)
|
||||
{
|
||||
const rootFolders = [bookmarksService.toolbarFolder, bookmarksService.bookmarksMenuFolder, bookmarksService.unfiledBookmarksFolder];
|
||||
const sleep = liberator.sleep;
|
||||
const sleep = liberator.sleep; // Storage objects are global to all windows, 'liberator' isn't.
|
||||
|
||||
let bookmarks = [];
|
||||
let self = this;
|
||||
@@ -1052,7 +1052,7 @@ function QuickMarks() //{{{
|
||||
////////////////////// PRIVATE SECTION /////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////{{{
|
||||
|
||||
var qmarks = storage.newMap("quickmarks", true);
|
||||
var qmarks = storage.newMap("quickmarks", true, { privateData: true });
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////}}}
|
||||
////////////////////// MAPPINGS ////////////////////////////////////////////////
|
||||
|
||||
@@ -1630,8 +1630,8 @@ function Marks() //{{{
|
||||
////////////////////// PRIVATE SECTION /////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////{{{
|
||||
|
||||
var localMarks = storage.newMap("local-marks", true);
|
||||
var urlMarks = storage.newMap("url-marks", true);
|
||||
var localMarks = storage.newMap("local-marks", true, { privateData: true });
|
||||
var urlMarks = storage.newMap("url-marks", true, { privateData: true });
|
||||
|
||||
var pendingJumps = [];
|
||||
var appContent = document.getElementById("appcontent");
|
||||
|
||||
@@ -345,7 +345,7 @@ function Events() //{{{
|
||||
|
||||
var lastFocus = null;
|
||||
|
||||
var macros = storage.newMap("macros", true);
|
||||
var macros = storage.newMap("macros", true, { privateData: true });
|
||||
|
||||
var currentMacro = "";
|
||||
var lastMacro = "";
|
||||
|
||||
@@ -135,7 +135,7 @@ Highlights.prototype.CSS = <![CDATA[
|
||||
*
|
||||
* @author Kris Maglione <maglione.k@gmail.com>
|
||||
*/
|
||||
function Highlights(name, store, serial)
|
||||
function Highlights(name, store)
|
||||
{
|
||||
let self = this;
|
||||
let highlight = {};
|
||||
@@ -247,7 +247,7 @@ function Highlights(name, store, serial)
|
||||
*
|
||||
* @author Kris Maglione <maglione.k@gmail.com>
|
||||
*/
|
||||
function Styles(name, store, serial)
|
||||
function Styles(name, store)
|
||||
{
|
||||
// Can't reference liberator or Components inside Styles --
|
||||
// they're members of the window object, which disappear
|
||||
|
||||
@@ -40,8 +40,8 @@ function CommandLine() //{{{
|
||||
////////////////////// PRIVATE SECTION /////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////{{{
|
||||
|
||||
storage.newArray("history-search", true);
|
||||
storage.newArray("history-command", true);
|
||||
storage.newArray("history-search", true, { privateData: true });
|
||||
storage.newArray("history-command", true, { privateData: true });
|
||||
|
||||
var messageHistory = { // {{{
|
||||
_messages: [],
|
||||
|
||||
@@ -706,16 +706,17 @@ const util = { //{{{
|
||||
/**
|
||||
* Array utility methods.
|
||||
*/
|
||||
util.Array = function Array(ary) {
|
||||
util.Array = function Array_(ary) {
|
||||
var obj = {
|
||||
__proto__: ary,
|
||||
__iterator__: function () this.iteritems(),
|
||||
__noSuchMethod__: function (meth, args) {
|
||||
let res = util.Array[meth].apply(null, [this.__proto__].concat(args));
|
||||
let res = (util.Array[meth] || Array[meth]).apply(null, [this.__proto__].concat(args));
|
||||
if (util.Array.isinstance(res))
|
||||
return util.Array(res);
|
||||
return res;
|
||||
}
|
||||
},
|
||||
map: function() this.__noSuchMethod__("map", Array.slice(arguments)),
|
||||
};
|
||||
return obj;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user