Commit 54dee8ce authored by grtgarrett's avatar grtgarrett
Browse files

Adding ability to see which previous sites you have been protected against.

parent 0644caf4
{
"pastSites": {
"message": "Decentraleyes has protected you on these past sites:",
"description": "Extension description."
},
"extensionDescription": {
"message": "Protects you against tracking through \"free\", centralized, content delivery.",
"description": "Extension description."
......
......@@ -248,6 +248,10 @@ footer {
font-weight: 400;
}
#sites-counter {
text-align: center;
}
/**
* Compatibility
*/
......
......@@ -56,6 +56,9 @@
<div class="subheading" data-i18n-content="amountInjectedTitle"></div>
<div class="description" data-i18n-content="amountInjectedDescription"></div>
<div class="subheading" data-i18n-content="pastSites"></div>
<div id="sites-counter" class="sublist">www.google.com</div>
</div>
</section>
......
......@@ -23,6 +23,22 @@ var popup = {};
* Private Methods
*/
popup._lastSites = async function () {
var pastTen = [];
pastTen.push(JSON.parse(localStorage.getItem('session')));
const [tab] = await browser.tabs.query({currentWindow: true, active:true});
if(pastTen.length < 10 && !pastTen[0].includes(tab.url)) {
pastTen.push(tab.url);
localStorage.setItem('session', JSON.stringify(pastTen));
}
console.log(pastTen);
return pastTen.toString();
};
popup._renderContents = function () {
helpers.insertI18nContentIntoDocument(document);
......@@ -38,13 +54,19 @@ popup._renderContents = function () {
popup._renderNonContextualContents = function () {
let versionLabelElement, counterElement, testingUtilityLinkElement, optionsButtonElement;
let versionLabelElement, counterElement, testingUtilityLinkElement, optionsButtonElement, lastSitesElement;
versionLabelElement = document.getElementById('version-label');
counterElement = document.getElementById('injection-counter');
testingUtilityLinkElement = document.getElementById('testing-utility-link');
optionsButtonElement = document.getElementById('options-button');
lastSitesElement = document.getElementById('sites-counter');
popup._lastSites().then(function(value) {
lastSitesElement.innerText = value;
});
versionLabelElement.innerText = popup._version;
counterElement.innerText = helpers.formatNumber(popup._amountInjected);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment