async function logSubject(details) {
try {
let securityInfo = await browser.webRequest.getSecurityInfo(
details.requestId,
{},
);
console.log(details.url);
if (securityInfo.state === "secure" || securityInfo.state === "weak") {
console.log(securityInfo.certificates[0].subject);
}
} catch (error) {
console.error(error);
}
}
window.onload = startCheck;
function startCheck()
{
browser.webRequest.onHeadersReceived.addListener(
logSubject,
{ urls: ["https://*.mozilla.org/*"] },
["blocking"],
);
}
version 1.0 beta
| |