From 1c30aad51cedb7b0a6efeaf7a605b731ab5490e1 Mon Sep 17 00:00:00 2001 From: Martin Stubenschrott Date: Sun, 2 Nov 2008 05:22:07 +0000 Subject: [PATCH] delay preloading after most tabs should be restored, makes Firefox startup. When we enable the awesomebar completions by default, we might even :set nopreload by default. --- content/bookmarks.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/content/bookmarks.js b/content/bookmarks.js index 8e564211..d08ce869 100644 --- a/content/bookmarks.js +++ b/content/bookmarks.js @@ -210,7 +210,11 @@ function Bookmarks() //{{{ liberator.registerObserver("enter", function () { if (options["preload"]) - cache.bookmarks; // Forces a load, if not already loaded. + { + // Forces a load, if not already loaded but wait 10sec + // so most tabs should be restored and the CPU should be idle again usually + setTimeout(function() { cache.bookmarks; }, 10000); + } }); /////////////////////////////////////////////////////////////////////////////}}} @@ -580,7 +584,11 @@ function History() //{{{ liberator.registerObserver("enter", function () { if (options["preload"]) - load(); + { + // Forces a load, if not already loaded but wait 15sec + // so that we don't load it at the same time as bookmarks + setTimeout(function() { load(); }, 15000); + } }); /////////////////////////////////////////////////////////////////////////////}}}