highlighting

master
km0 2 years ago
parent 698997b1ce
commit c74a3b86e9

@ -20,7 +20,6 @@ const syncCategories = function (selected) {
let checkbox = accordion.querySelector(".switch input");
let category = checkbox.id;
console.log(category);
checkbox.checked = selected.includes(category);
checkbox.addEventListener("change", () => {

@ -1,15 +1,21 @@
let categories = {
collect: {
title: "Collection of Data",
keywords: ["data", "collect"],
keywords: ["data center", "data", "collect", "content and data", "collect data"],
},
usage: {
title: "How do they use this data",
keywords: ["usage", "use"],
keywords: ["data to", "data from", "your data", "use of data"],
},
third: {
title: "Usage of Data",
keywords: ["share", "third", "companies", "party"],
title: "Sharing your data",
keywords: [
"share content",
"share information",
"share your",
"third party",
"third countries",
],
},
location: {
title: "Location",
@ -17,7 +23,7 @@ let categories = {
},
permission: {
title: "Permission and Consent",
keywords: ["permission", "consent"],
keywords: ["your permission", "device permission"],
},
upload: {
title: "Uploaded Contents",
@ -25,7 +31,7 @@ let categories = {
},
suspension: {
title: "Suspension of the account",
keywords: ["suspension", "termination", "ban", "suspend", "disable", "account", "breached"],
keywords: ["suspension", "termination", "ban", "suspend", "disable", "breached"],
},
};

@ -51,8 +51,12 @@ activate.addEventListener("click", async () => {
function highlightSelected(active) {
chrome.storage.sync.get(["categories", "selected"], (result) => {
for (const el of document.querySelectorAll("*")) {
for (const el of document.querySelectorAll("*:not(html, body)")) {
el.style.visibility = active ? "hidden" : "visible";
el.style.backgroundColor = "";
el.style.color = "";
// el.style.height = "0px";
// el.style.display = active ? "none" : "";
}
if (active) {
@ -69,9 +73,18 @@ function highlightSelected(active) {
wrapped.innerHTML = finding.textContent;
wrapped.style.visibility = "visible";
wrapped.style.backgroundColor = "#1834e9";
wrapped.style.color = "white";
let target = finding.parentElement;
target.replaceChild(wrapped, finding);
// wrapped.style.display = "";
// let upper = target;
// while (upper.parentElement) {
// upper.style.display = "";
// upper = upper.parentElement;
// }
}
}
});

Loading…
Cancel
Save