Skip to content

Commit

Permalink
Fix a data initialization issue (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
yunzhu-li committed Aug 9, 2017
1 parent 6679c65 commit cb31689
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions certificate-info/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ function displayPageInfo(tabId, pageProtocol, loading, validationData) {
updateBadge(tabId, validationData['result_color'], validationData['validation_result_short']);
updatePopupData(tabId, validationData['result_color'], validationData['validation_result'], validationData['cert_organization'], validationData['message']);
} else {
// Clear badge
// Clear badge and popup data
updateBadge(tabId, '', '');
updatePopupData(tabId, 'gray', 'No HTTP(S) page loaded', '', 'Certificate information will display here when you open an HTTPS page.');
delete popupData[tabId];
}
}

Expand Down
2 changes: 1 addition & 1 deletion certificate-info/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "Certificate Info",
"description": "Shows TLS certificate info and validation level of the servers you connect.",
"version": "0.0.8",
"version": "0.0.9",

"icons": {
"16": "icon_16.png",
Expand Down
8 changes: 4 additions & 4 deletions certificate-info/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
}
.title-box {
color: #FFF;
background: #FF9800;
background: #888;
padding: 4px;
border-radius: 4px;
};
</style>
</head>
<body>
<p><span id="lblValidationResult" class="title-box">Validation Result</span></p>
<p style="margin-top: 18px;"><span id="lblCertOrganization"><b>Organization</b></span></p>
<p><span id="lblMessage">Message</span></p>
<p><span id="lblValidationResult" class="title-box">No HTTP(S) page loaded</span></p>
<p style="margin-top: 18px;"><span id="lblCertOrganization"><b></b></span></p>
<p><span id="lblMessage">Certificate information will display here when you open an HTTPS page.</span></p>
</body>
</html>
2 changes: 2 additions & 0 deletions certificate-info/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ document.addEventListener('DOMContentLoaded', function () {
var currentTabId = background.currentTabId;
var popupData = background.popupData[currentTabId];

if (typeof popupData === 'undefined') return;

document.getElementById('lblValidationResult').style['background'] = popupData['color'];
document.getElementById('lblValidationResult').innerHTML = popupData['validation_result'];
document.getElementById('lblCertOrganization').innerHTML = '<b>' + popupData['cert_organization'] + '</b>';
Expand Down

0 comments on commit cb31689

Please # to comment.