Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function showCertDetails(cert, domMismatch, ev, win) {
var svCert = cert.serverCert,
validity = svCert.validity.QueryInterface(Ci.nsIX509CertValidity),
doc = win.document;
const rp = ui.prefs['rating.params'];
const panelInfo = ui.prefs['panel.info'];
doc.getElementById('ssleuth-text-cert-common-name').textContent = svCert.commonName;
var certRating = doc.getElementById('ssleuth-cert-status-rating'),
evRating = doc.getElementById('ssleuth-cert-ev-rating'),
elemEV = doc.getElementById('ssleuth-text-cert-extended-validation');
if (ev) {
elemEV.textContent = utils.getText('general.yes');
elemEV.setAttribute('ev', 'Yes');
} else {
elemEV.textContent = utils.getText('general.no');
elemEV.setAttribute('ev', 'No');
}
var rating = (Number(ev) * rp.evCert).toFixed(1);
evRating.textContent = _fmt(rating) + '/' + _fmt(rp.evCert);