mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-07 16:24:12 +01:00
Add 'const service'
This commit is contained in:
@@ -1541,10 +1541,9 @@ function Events() //{{{
|
||||
// XXX: function may later be needed to detect a canceled synchronous openURL()
|
||||
onStateChange: function (webProgress, request, flags, status)
|
||||
{
|
||||
const nsIWebProgressListener = Ci.nsIWebProgressListener;
|
||||
// STATE_IS_DOCUMENT | STATE_IS_WINDOW is important, because we also
|
||||
// receive statechange events for loading images and other parts of the web page
|
||||
if (flags & (nsIWebProgressListener.STATE_IS_DOCUMENT | nsIWebProgressListener.STATE_IS_WINDOW))
|
||||
if (flags & (Ci.nsIWebProgressListener.STATE_IS_DOCUMENT | Ci.nsIWebProgressListener.STATE_IS_WINDOW))
|
||||
{
|
||||
// This fires when the load event is initiated
|
||||
// only thrown for the current tab, not when another tab changes
|
||||
@@ -1573,12 +1572,11 @@ function Events() //{{{
|
||||
// for notifying the user about secure web pages
|
||||
onSecurityChange: function (webProgress, aRequest, aState)
|
||||
{
|
||||
const nsIWebProgressListener = Ci.nsIWebProgressListener;
|
||||
if (aState & nsIWebProgressListener.STATE_IS_INSECURE)
|
||||
if (aState & Ci.nsIWebProgressListener.STATE_IS_INSECURE)
|
||||
statusline.setClass("insecure");
|
||||
else if (aState & nsIWebProgressListener.STATE_IS_BROKEN)
|
||||
else if (aState & Ci.nsIWebProgressListener.STATE_IS_BROKEN)
|
||||
statusline.setClass("broken");
|
||||
else if (aState & nsIWebProgressListener.STATE_IS_SECURE)
|
||||
else if (aState & Ci.nsIWebProgressListener.STATE_IS_SECURE)
|
||||
statusline.setClass("secure");
|
||||
},
|
||||
onStatusChange: function (webProgress, request, status, message)
|
||||
@@ -1638,9 +1636,8 @@ function Events() //{{{
|
||||
prefObserver: {
|
||||
register: function ()
|
||||
{
|
||||
const prefService = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefService);
|
||||
this._branch = prefService.getBranch(""); // better way to monitor all changes?
|
||||
this._branch.QueryInterface(Ci.nsIPrefBranch2);
|
||||
this._branch = service.pref.getBranch("") // better way to monitor all changes?
|
||||
.QueryInterface(Ci.nsIPrefBranch2);
|
||||
this._branch.addObserver("", this, false);
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user