fix(browser-extension): background and content minor bugs
This commit is contained in:
parent
5f3d346eb8
commit
b1b9b092b2
@ -93,8 +93,8 @@ const query = async (key, callback) => {
|
||||
const queryTab = (callback) => {
|
||||
chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => {
|
||||
callback({
|
||||
id: tabs[0].id,
|
||||
hostname: new URL(tabs[0].url).hostname,
|
||||
id: tabs[0]?.id,
|
||||
hostname: new URL(tabs[0].url).hostname.split('.').slice(-2).join('.'),
|
||||
});
|
||||
});
|
||||
};
|
||||
@ -112,7 +112,7 @@ const report = () => {
|
||||
if (tab) {
|
||||
fetch(`${apiUrl}/report/`, {
|
||||
body: JSON.stringify({
|
||||
text: `There's a problem with ${tab.url} using ${userAgent} in CDM ${version}`,
|
||||
html: `<b>Browser:</b> ${userAgent}<br/><b>Site:</b> ${tab.url}<br/> <b>Version:</b> ${version}`,
|
||||
to: 'wanhose.development@gmail.com',
|
||||
subject: 'Cookie Dialog Monster Report',
|
||||
}),
|
||||
|
@ -78,7 +78,9 @@ const check = (node) =>
|
||||
|
||||
const clean = (nodes) => {
|
||||
if (selectors.length) {
|
||||
nodes.filter(check).forEach((node) => (node.outerHTML = ''));
|
||||
nodes.filter(check).forEach((node) => {
|
||||
if (node.parentElement) node.outerHTML = '';
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user