mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 09:57:59 +01:00
Fix: bookmarks.js loading error.
liberator.modules.options has not been defined when bookmarks.js is loading.
This commit is contained in:
@@ -28,26 +28,26 @@ the terms of any one of the MPL, the GPL or the LGPL.
|
||||
|
||||
const DEFAULT_FAVICON = "chrome://mozapps/skin/places/defaultFavicon.png";
|
||||
|
||||
if (liberator.options.getPref("extensions.vimperator.commandline_cmd_history"))
|
||||
{
|
||||
// Try to import older command line history, quick marks, etc.
|
||||
liberator.registerObserver("load_options", function () {
|
||||
let store = liberator.storage["history-command"];
|
||||
let pref = liberator.options.getPref("extensions.vimperator.commandline_cmd_history");
|
||||
for (let [k, v] in Iterator(pref.split("\n")))
|
||||
store.push(v);
|
||||
// Try to import older command line history, quick marks, etc.
|
||||
liberator.registerObserver("load_options", function () {
|
||||
if (!liberator.modules.options.getPref("extensions.vimperator.commandline_cmd_history"))
|
||||
return;
|
||||
|
||||
store = liberator.storage["quickmarks"];
|
||||
pref = liberator.options.getPref("extensions.vimperator.quickmarks")
|
||||
.split("\n");
|
||||
while (pref.length > 0)
|
||||
store.set(pref.shift(), pref.shift());
|
||||
let store = liberator.storage["history-command"];
|
||||
let pref = liberator.options.getPref("extensions.vimperator.commandline_cmd_history");
|
||||
for (let [k, v] in Iterator(pref.split("\n")))
|
||||
store.push(v);
|
||||
|
||||
liberator.options.resetPref("extensions.vimperator.commandline_cmd_history");
|
||||
liberator.options.resetPref("extensions.vimperator.commandline_search_history");
|
||||
liberator.options.resetPref("extensions.vimperator.quickmarks");
|
||||
});
|
||||
}
|
||||
store = liberator.storage["quickmarks"];
|
||||
pref = liberator.options.getPref("extensions.vimperator.quickmarks")
|
||||
.split("\n");
|
||||
while (pref.length > 0)
|
||||
store.set(pref.shift(), pref.shift());
|
||||
|
||||
liberator.options.resetPref("extensions.vimperator.commandline_cmd_history");
|
||||
liberator.options.resetPref("extensions.vimperator.commandline_search_history");
|
||||
liberator.options.resetPref("extensions.vimperator.quickmarks");
|
||||
});
|
||||
|
||||
// also includes methods for dealing with keywords and search engines
|
||||
function Bookmarks() //{{{
|
||||
|
||||
Reference in New Issue
Block a user