Created
June 17, 2012 07:41
-
-
Save caisui/2943844 to your computer and use it in GitHub Desktop.
compatible service.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!services.services.pref) { | |
[ | |
["appStartup", "startup"], | |
["browserSearch", "search"], | |
["directory", "dirsvc"], | |
["observer", "obs"], | |
["pref", "prefs"], | |
["subscriptLoader", "scriptloader"], | |
["windowMediator", "wm"], | |
["windowWatcher", "ww"], | |
["xulAppInfo", "appinfo"], | |
].forEach(function ([name1, name2]) { | |
services.services.__defineGetter__(name1, function () { | |
delete this[name1]; | |
Cu.reportError('services.get:' + name1 + ' is renamed ' + name2); | |
return this[name1] = {reference: services.get(name2)}; | |
}); | |
}); | |
if (Ci.nsILivemarkService) | |
services.add( | |
"livemark", | |
"@mozilla.org/browser/livemark-service;2", | |
Ci.nsILivemarkService); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment