Add settings page
This commit is contained in:
@ -1,15 +1,21 @@
|
||||
|
||||
var xhr = new XMLHttpRequest();
|
||||
|
||||
function onGot(item) {
|
||||
var API = "http://httpspluschecker.virtit.fr/?domain=";
|
||||
if (item.API) {
|
||||
API = item.API;
|
||||
}
|
||||
|
||||
|
||||
browser.tabs.query({ active: true, lastFocusedWindow: true }).then(function(tab) {
|
||||
const url = new URL(tab[0].url);
|
||||
if (url.protocol === "http:" || url.protocol === "https:" ) {
|
||||
console.log("onGot : " + API)
|
||||
var host = url.hostname ;
|
||||
|
||||
xhr.open('GET', 'https://httpspluschecker.virtit.fr/?domain=' + host, false);
|
||||
xhr.open('GET', API + host, false);
|
||||
xhr.send();
|
||||
|
||||
|
||||
value = JSON.parse(xhr.responseText);
|
||||
|
||||
if (value['DNSSEC'] === true ) {
|
||||
@ -35,3 +41,9 @@ browser.tabs.query({ active: true, lastFocusedWindow: true }).then(function(tab)
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
var getting = browser.storage.local.get("API");
|
||||
getting.then(onGot);
|
||||
|
@ -2,7 +2,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" href=" style.css">
|
||||
<script type="text/javascript" src="dnssec.js"></script>
|
||||
<script type="text/javascript" src="checks.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@ -18,4 +18,4 @@
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
@ -28,4 +28,4 @@ td {
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
font-size: 18px;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user