mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-13 07:05:48 +01:00
Cc/Ci/Cr/Cu
This commit is contained in:
@@ -40,12 +40,9 @@ function Bookmarks() //{{{
|
|||||||
const historyService = PlacesUtils.history;
|
const historyService = PlacesUtils.history;
|
||||||
const bookmarksService = PlacesUtils.bookmarks;
|
const bookmarksService = PlacesUtils.bookmarks;
|
||||||
const taggingService = PlacesUtils.tagging;
|
const taggingService = PlacesUtils.tagging;
|
||||||
const searchService = Components.classes["@mozilla.org/browser/search-service;1"]
|
const searchService = Cc["@mozilla.org/browser/search-service;1"].getService(Ci.nsIBrowserSearchService);
|
||||||
.getService(Components.interfaces.nsIBrowserSearchService);
|
const ioService = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
|
||||||
const ioService = Components.classes["@mozilla.org/network/io-service;1"]
|
const faviconService = Cc["@mozilla.org/browser/favicon-service;1"].getService(Ci.nsIFaviconService);
|
||||||
.getService(Components.interfaces.nsIIOService);
|
|
||||||
const faviconService = Components.classes["@mozilla.org/browser/favicon-service;1"]
|
|
||||||
.getService(Components.interfaces.nsIFaviconService);
|
|
||||||
|
|
||||||
const Bookmark = new Struct("url", "title", "icon", "keyword", "tags", "id");
|
const Bookmark = new Struct("url", "title", "icon", "keyword", "tags", "id");
|
||||||
const Keyword = new Struct("keyword", "title", "icon", "url");
|
const Keyword = new Struct("keyword", "title", "icon", "url");
|
||||||
@@ -183,9 +180,9 @@ function Bookmarks() //{{{
|
|||||||
},
|
},
|
||||||
QueryInterface: function QueryInterface(iid)
|
QueryInterface: function QueryInterface(iid)
|
||||||
{
|
{
|
||||||
if (iid.equals(Components.interfaces.nsINavBookmarkObserver) || iid.equals(Components.interfaces.nsISupports))
|
if (iid.equals(Ci.nsINavBookmarkObserver) || iid.equals(Ci.nsISupports))
|
||||||
return this;
|
return this;
|
||||||
throw Components.results.NS_ERROR_NO_INTERFACE;
|
throw Cr.NS_ERROR_NO_INTERFACE;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -536,8 +533,7 @@ function Bookmarks() //{{{
|
|||||||
|
|
||||||
getSuggestions: function getSuggestions(engine, query, callback)
|
getSuggestions: function getSuggestions(engine, query, callback)
|
||||||
{
|
{
|
||||||
let ss = Components.classes["@mozilla.org/browser/search-service;1"]
|
let ss = Cc["@mozilla.org/browser/search-service;1"].getService(Ci.nsIBrowserSearchService);
|
||||||
.getService(Components.interfaces.nsIBrowserSearchService);
|
|
||||||
const responseType = "application/x-suggestions+json";
|
const responseType = "application/x-suggestions+json";
|
||||||
|
|
||||||
let engine = ss.getEngineByAlias(engine);
|
let engine = ss.getEngineByAlias(engine);
|
||||||
@@ -548,8 +544,7 @@ function Bookmarks() //{{{
|
|||||||
|
|
||||||
function process(resp)
|
function process(resp)
|
||||||
{
|
{
|
||||||
const json = Components.classes["@mozilla.org/dom/json;1"]
|
const json = Cc["@mozilla.org/dom/json;1"].createInstance(Ci.nsIJSON);
|
||||||
.createInstance(Components.interfaces.nsIJSON);
|
|
||||||
let results = [];
|
let results = [];
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ const config = { //{{{
|
|||||||
["checkupdates", "Check for updates",
|
["checkupdates", "Check for updates",
|
||||||
function () { window.checkForUpdates(); }],
|
function () { window.checkForUpdates(); }],
|
||||||
["cleardata", "Clear private data",
|
["cleardata", "Clear private data",
|
||||||
function () { Components.classes[GLUE_CID].getService(Components.interfaces.nsIBrowserGlue).sanitize(window || null); }],
|
function () { Cc[GLUE_CID].getService(Ci.nsIBrowserGlue).sanitize(window || null); }],
|
||||||
["cookies", "List your cookies",
|
["cookies", "List your cookies",
|
||||||
function () { window.toOpenWindowByType("Browser:Cookies", "chrome://browser/content/preferences/cookies.xul", "chrome,dialog=no,resizable"); }],
|
function () { window.toOpenWindowByType("Browser:Cookies", "chrome://browser/content/preferences/cookies.xul", "chrome,dialog=no,resizable"); }],
|
||||||
["console", "JavaScript console",
|
["console", "JavaScript console",
|
||||||
@@ -338,8 +338,8 @@ const config = { //{{{
|
|||||||
"Redraw the screen",
|
"Redraw the screen",
|
||||||
function ()
|
function ()
|
||||||
{
|
{
|
||||||
let wu = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
|
let wu = window.QueryInterface(Ci.nsIInterfaceRequestor).
|
||||||
getInterface(Components.interfaces.nsIDOMWindowUtils);
|
getInterface(Ci.nsIDOMWindowUtils);
|
||||||
wu.redraw();
|
wu.redraw();
|
||||||
modes.show();
|
modes.show();
|
||||||
},
|
},
|
||||||
@@ -418,8 +418,7 @@ const config = { //{{{
|
|||||||
{
|
{
|
||||||
setter: function (value)
|
setter: function (value)
|
||||||
{
|
{
|
||||||
const ioService = Components.classes['@mozilla.org/network/io-service;1']
|
const ioService = Cc['@mozilla.org/network/io-service;1'].getService(Ci.nsIIOService2);
|
||||||
.getService(Components.interfaces.nsIIOService2);
|
|
||||||
|
|
||||||
ioService.offline = !value;
|
ioService.offline = !value;
|
||||||
gPrefService.setBoolPref("browser.offline", ioService.offline);
|
gPrefService.setBoolPref("browser.offline", ioService.offline);
|
||||||
@@ -428,8 +427,7 @@ const config = { //{{{
|
|||||||
},
|
},
|
||||||
getter: function ()
|
getter: function ()
|
||||||
{
|
{
|
||||||
return Components.classes['@mozilla.org/network/io-service;1']
|
return Cc['@mozilla.org/network/io-service;1'].getService(Ci.nsIIOService2).offline;
|
||||||
.getService(Components.interfaces.nsIIOService2).offline;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user