mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 17:07:58 +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";
|
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 () {
|
||||||
// Try to import older command line history, quick marks, etc.
|
if (!liberator.modules.options.getPref("extensions.vimperator.commandline_cmd_history"))
|
||||||
liberator.registerObserver("load_options", function () {
|
return;
|
||||||
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);
|
|
||||||
|
|
||||||
store = liberator.storage["quickmarks"];
|
let store = liberator.storage["history-command"];
|
||||||
pref = liberator.options.getPref("extensions.vimperator.quickmarks")
|
let pref = liberator.options.getPref("extensions.vimperator.commandline_cmd_history");
|
||||||
.split("\n");
|
for (let [k, v] in Iterator(pref.split("\n")))
|
||||||
while (pref.length > 0)
|
store.push(v);
|
||||||
store.set(pref.shift(), pref.shift());
|
|
||||||
|
|
||||||
liberator.options.resetPref("extensions.vimperator.commandline_cmd_history");
|
store = liberator.storage["quickmarks"];
|
||||||
liberator.options.resetPref("extensions.vimperator.commandline_search_history");
|
pref = liberator.options.getPref("extensions.vimperator.quickmarks")
|
||||||
liberator.options.resetPref("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
|
// also includes methods for dealing with keywords and search engines
|
||||||
function Bookmarks() //{{{
|
function Bookmarks() //{{{
|
||||||
|
|||||||
Reference in New Issue
Block a user