mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-03 15:24:11 +01:00
Add 'const service'
This commit is contained in:
@@ -40,8 +40,8 @@ function Bookmarks() //{{{
|
||||
const historyService = PlacesUtils.history;
|
||||
const bookmarksService = PlacesUtils.bookmarks;
|
||||
const taggingService = PlacesUtils.tagging;
|
||||
const searchService = Cc["@mozilla.org/browser/search-service;1"].getService(Ci.nsIBrowserSearchService);
|
||||
const ioService = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
|
||||
const searchService = service.browserSearch;
|
||||
const ioService = service.io;
|
||||
const faviconService = Cc["@mozilla.org/browser/favicon-service;1"].getService(Ci.nsIFaviconService);
|
||||
|
||||
const Bookmark = new Struct("url", "title", "icon", "keyword", "tags", "id");
|
||||
@@ -533,7 +533,7 @@ function Bookmarks() //{{{
|
||||
|
||||
getSuggestions: function getSuggestions(engine, query, callback)
|
||||
{
|
||||
let ss = Cc["@mozilla.org/browser/search-service;1"].getService(Ci.nsIBrowserSearchService);
|
||||
let ss = service.browserSearch;
|
||||
const responseType = "application/x-suggestions+json";
|
||||
|
||||
let engine = ss.getEngineByAlias(engine);
|
||||
@@ -544,7 +544,7 @@ function Bookmarks() //{{{
|
||||
|
||||
function process(resp)
|
||||
{
|
||||
const json = Cc["@mozilla.org/dom/json;1"].createInstance(Ci.nsIJSON);
|
||||
const json = service.json;
|
||||
let results = [];
|
||||
try
|
||||
{
|
||||
|
||||
@@ -418,16 +418,13 @@ const config = { //{{{
|
||||
{
|
||||
setter: function (value)
|
||||
{
|
||||
const ioService = Cc['@mozilla.org/network/io-service;1'].getService(Ci.nsIIOService2);
|
||||
|
||||
ioService.offline = !value;
|
||||
gPrefService.setBoolPref("browser.offline", ioService.offline);
|
||||
|
||||
gPrefService.setBoolPref("browser.offline", service.io.offline);
|
||||
return value;
|
||||
},
|
||||
getter: function ()
|
||||
{
|
||||
return Cc['@mozilla.org/network/io-service;1'].getService(Ci.nsIIOService2).offline;
|
||||
return service.io.offline;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user