diff options
Diffstat (limited to 'toolkit/components')
-rw-r--r-- | toolkit/components/prompts/content/commonDialog.js | 2 | ||||
-rw-r--r-- | toolkit/components/search/orginal/nsSearchService.js | 20 |
2 files changed, 19 insertions, 3 deletions
diff --git a/toolkit/components/prompts/content/commonDialog.js b/toolkit/components/prompts/content/commonDialog.js index ef4686654..70b373d1f 100644 --- a/toolkit/components/prompts/content/commonDialog.js +++ b/toolkit/components/prompts/content/commonDialog.js @@ -50,8 +50,6 @@ function commonDialogOnLoad() { Dialog = new CommonDialog(args, ui); Dialog.onLoad(dialog); - // resize the window to the content - window.sizeToContent(); window.getAttention(); } diff --git a/toolkit/components/search/orginal/nsSearchService.js b/toolkit/components/search/orginal/nsSearchService.js index 56d378b39..8d81e1a27 100644 --- a/toolkit/components/search/orginal/nsSearchService.js +++ b/toolkit/components/search/orginal/nsSearchService.js @@ -2237,7 +2237,10 @@ Engine.prototype = { get lazySerializeTask() { if (!this._lazySerializeTask) { let task = function taskCallback() { - this._serializeToFile(); + // This check should be done by caller, but it is better to be safe than sorry. + if (!this._readOnly && this._file) { + this._serializeToFile(); + } }.bind(this); this._lazySerializeTask = new DeferredTask(task, LAZY_SERIALIZE_DELAY); } @@ -2245,6 +2248,17 @@ Engine.prototype = { return this._lazySerializeTask; }, + // This API is required by some search engine management extensions, so let's restore it. + // Old API was using a timer to do its work, but this can lead us too far. If extension is + // rely on such subtle internal details, that extension should be fixed, not browser. + _lazySerializeToFile: function SRCH_ENG_lazySerializeToFile() { + // This check should be done by caller, but it is better to be safe than sorry. + // Besides, we don't have to create a task for r/o or non-file engines. + if (!this._readOnly && this._file) { + this.lazySerializeTask.arm(); + } + }, + /** * Serializes the engine object to file. */ @@ -3058,6 +3072,10 @@ SearchService.prototype = { continue; } + // Write out serialized search engine files when rebuilding cache. + // Do it lazily, to: 1) reuse existing API; 2) make browser interface more responsive + engine._lazySerializeToFile(); + let cacheKey = parent.path; if (!cache.directories[cacheKey]) { let cacheEntry = {}; |