diff --git a/common/content/buffer.js b/common/content/buffer.js index f9bb62cb..43fc3e41 100644 --- a/common/content/buffer.js +++ b/common/content/buffer.js @@ -265,9 +265,16 @@ var Buffer = Module("buffer", { // for notifying the user about secure web pages onSecurityChange: function onSecurityChange(webProgress, request, state) { onSecurityChange.superapply(this, arguments); + if (state & Ci.nsIWebProgressListener.STATE_IS_BROKEN) + statusline.security = "broken"; + else if (state & Ci.nsIWebProgressListener.STATE_IDENTITY_EV_TOPLEVEL) + statusline.security = "extended"; + else if (state & Ci.nsIWebProgressListener.STATE_SECURE_HIGH) + statusline.security = "secure"; + else // if (state & Ci.nsIWebProgressListener.STATE_IS_INSECURE) + statusline.security = "insecure"; if (webProgress && webProgress.DOMWindow) - webProgress.DOMWindow.document.dactylSecurity = state; - statusline.security = state; + webProgress.DOMWindow.document.dactylSecurity = statusline.security; }, onStatusChange: function onStatusChange(webProgress, request, status, message) { onStatusChange.superapply(this, arguments); diff --git a/common/content/statusline.js b/common/content/statusline.js index 0eb849ed..85e6afec 100644 --- a/common/content/statusline.js +++ b/common/content/statusline.js @@ -82,8 +82,8 @@ var StatusLine = Module("statusline", { * * @param {'extended'|'secure'|'broken'|'insecure'} type */ - set class(type) { - this._class = type; + set security(type) { + this._security = type; const highlightGroup = { extended: "StatusLineExtended", secure: "StatusLineSecure", @@ -93,17 +93,7 @@ var StatusLine = Module("statusline", { highlight.highlightNode(this.statusBar, this.baseGroup + highlightGroup[type]); }, - get class() this._class, - set security(state) { - if (state & Ci.nsIWebProgressListener.STATE_IS_BROKEN) - this.class = "broken"; - else if (state & Ci.nsIWebProgressListener.STATE_IDENTITY_EV_TOPLEVEL) - this.class = "extended"; - else if (state & Ci.nsIWebProgressListener.STATE_SECURE_HIGH) - this.class = "secure"; - else // if (state & Ci.nsIWebProgressListener.STATE_IS_INSECURE) - this.class = "insecure"; - }, + get security() this._security, // update all fields of the statusline update: function update() {