1
0
Fork 0

allow clearing cache

This commit is contained in:
Lukas Winkler 2017-09-22 11:19:34 +02:00
parent 04bcbde06d
commit f1d485ab25
5 changed files with 33 additions and 5 deletions

View file

@ -20,7 +20,7 @@ function displayData(data, tabId, typo3) {
path: {
"128": "img/" + icon + ".128.png"
}
})
});
}
function handleMessage(request, sender) {
@ -50,7 +50,7 @@ function handleMessage(request, sender) {
if (cl.readyState === 4) {
if (cl.status === 200) {
var changelog = cl.responseText.split('\n', 1)[0];
const regex = /(\d\.)+(\d+)/;
var regex = /(\d\.)+(\d+)/;
var match = regex.exec(changelog);
data.t3version = match[0];
}
@ -81,12 +81,12 @@ function handleMessage(request, sender) {
xmlHttp.send();
}
else {
displayData(data, tabId, true)
displayData(data, tabId, true);
}
});
}
else {
displayData(false, tabId, false)
displayData(false, tabId, false);
}
}

View file

@ -31,5 +31,9 @@
"scripts": [
"background.js"
]
},
"options_ui": {
"page": "options.html",
"chrome_style": true
}
}

15
options.html Normal file
View file

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<title>Mask Detector</title>
</head>
<body style="text-align: center">
<button id="clearCache">Cache leeren</button>
<div id="success" style="display:none;">
Cache erfolgreich geleert<br>
<button id="close">Schließen</button>
</div>
<script src="options.js"></script>
</body>
</html>

9
options.js Normal file
View file

@ -0,0 +1,9 @@
document.getElementById("clearCache").addEventListener("click", function () {
chrome.storage.local.clear(function () {
document.getElementById("success").style.display = "block";
});
});
document.getElementById("close").addEventListener("click", function () {
window.close();
});

View file

@ -7,7 +7,7 @@ chrome.tabs.query({active: true}, function (tabs) {
if (result[key].mask.modified) {
text = result[key].mask.modified;
} else if (result[key].tv.modified) {
text = result[key].tv.modified
text = result[key].tv.modified;
}
}
if (text) {