diff --git a/components/keyconfig-service.js b/components/keyconfig-service.js index 3d7718e..f8ef8df 100755 --- a/components/keyconfig-service.js +++ b/components/keyconfig-service.js @@ -1,3 +1,5 @@ +Components.utils.import("chrome://keyconfig/content/defaultPreferencesLoader.jsm"); + function NSGetModule(compMgr, fileSpec) { return Module; } function NSGetFactory() { return Factory; } @@ -60,6 +62,22 @@ keyconfigService.prototype = { }, init: function(event) { + // Current Thunderbird nightly builds do not load default preferences + // from overlay add-ons. They're probably going to fix this, but it may go + // away again at some point in the future, and in any case we'll need to do + // it ourselves when we convert from overlay to bootstrapped, and there + // shouldn't be any harm in setting the default values of preferences twice + // (i.e., both Thunderbird and our code doing it). + // This is in a try/catch because if it fails it's probably because + // setStringPref failed, in which case we're running inside an earlier + // application version which has already loaded the default preferences + // automatically. + try { + var loader = new DefaultPreferencesLoader(); + loader.parseUri( + "chrome://keyconfig-defaults/content/preferences/keyconfig.js"); + } catch (ex) {} + if(event && event.eventPhase != 2) return; this.removeEventListener("pageshow",this.keyconfig.service.init,false); diff --git a/content/keyconfig.js b/content/keyconfig.js index 2913b28..213e9c3 100755 --- a/content/keyconfig.js +++ b/content/keyconfig.js @@ -1,5 +1,3 @@ -Components.utils.import("chrome://keyconfig/content/defaultPreferencesLoader.jsm"); - var gPrefService = Components.classes['@mozilla.org/preferences-service;1'] .getService(Components.interfaces.nsIPrefService).getBranch(""); var gUnicodeConverter = Components.classes['@mozilla.org/intl/scriptableunicodeconverter'] @@ -19,22 +17,6 @@ var gVKNames = []; var gReverseNames; function onLoad() { - // Current Thunderbird nightly builds do not load default preferences - // from overlay add-ons. They're probably going to fix this, but it may go - // away again at some point in the future, and in any case we'll need to do - // it ourselves when we convert from overlay to bootstrapped, and there - // shouldn't be any harm in setting the default values of preferences twice - // (i.e., both Thunderbird and our code doing it). - // This is in a try/catch because if it fails it's probably because - // setStringPref failed, in which case we're running inside an earlier - // application version which has already loaded the default preferences - // automatically. - try { - var loader = new DefaultPreferencesLoader(); - loader.parseUri( - "chrome://keyconfig-defaults/content/preferences/keyconfig.js"); - } catch (ex) {} - gUnicodeConverter.charset = "UTF-8"; gExtra2 = document.documentElement.getButton("extra2"); diff --git a/install.rdf b/install.rdf index 8c1c7dd..cb5e8a8 100755 --- a/install.rdf +++ b/install.rdf @@ -6,7 +6,7 @@ keyconfig@mozilla.dorando.at Dorando keyconfig - 2017.1 + 2017.2 Dorando Hadar Hagai trlkly