commit
41fc20c2ac
@ -1,37 +0,0 @@
|
|||||||
appconsent_noscroll
|
|
||||||
b-modal-banner--disabled
|
|
||||||
blocked
|
|
||||||
bodyBlocked
|
|
||||||
c24-cc-visible
|
|
||||||
cbar
|
|
||||||
ccm-blocked
|
|
||||||
cli-barmodal-open
|
|
||||||
cmp-open
|
|
||||||
consent-modal-open
|
|
||||||
consent-modal-overflow
|
|
||||||
cookie_consent
|
|
||||||
CookiePolicy--show
|
|
||||||
cookies
|
|
||||||
cu_k_cookie_consent_modal_open
|
|
||||||
didomi-popup-open
|
|
||||||
gcdc-locked
|
|
||||||
gdpr-infobar-visible
|
|
||||||
gdprbanner_consent_gdpr_consent
|
|
||||||
gdprCookieBanner-acceptedAll
|
|
||||||
hasCookieBanner
|
|
||||||
ibeugdpr-disabled
|
|
||||||
idxrcookies-block-user-nav
|
|
||||||
modal--is-open
|
|
||||||
modal-open
|
|
||||||
no_scroll
|
|
||||||
no-scroll
|
|
||||||
noScroll
|
|
||||||
popin-gdpr-no-scroll
|
|
||||||
shopee-no-scroll
|
|
||||||
show-cookie-policy-info
|
|
||||||
sp-message-open
|
|
||||||
start-cookies
|
|
||||||
ta-cc-modal-open
|
|
||||||
touchevents-false
|
|
||||||
wt-cli-eu-country
|
|
||||||
wt-cli-geoip-on
|
|
12715
data/elements.txt
12715
data/elements.txt
File diff suppressed because it is too large
Load Diff
@ -1,30 +0,0 @@
|
|||||||
app.diagrams.net
|
|
||||||
blog.sapegin.me
|
|
||||||
buyagift.co.uk
|
|
||||||
canvasjs.com
|
|
||||||
chessmadra.com
|
|
||||||
correos.es
|
|
||||||
diariodeunlondinense.com
|
|
||||||
flickr.com
|
|
||||||
godotforums.org
|
|
||||||
godotvr.github.io
|
|
||||||
google.*
|
|
||||||
iea.org
|
|
||||||
jobs.lever.co
|
|
||||||
key-shortcut.com
|
|
||||||
login.microsoftonline.com
|
|
||||||
mantisbt.org
|
|
||||||
mossgreen.github.io
|
|
||||||
musicmeter.nl
|
|
||||||
personio.com
|
|
||||||
restaurantguru.com
|
|
||||||
retroachievements.org
|
|
||||||
seeklogo.com
|
|
||||||
shuttledirect.com
|
|
||||||
stackage.org
|
|
||||||
steamcommunity.com
|
|
||||||
substack.com
|
|
||||||
sucuri.net
|
|
||||||
tesla.com
|
|
||||||
visualstudio.com
|
|
||||||
youtube.com
|
|
113
data/tags.txt
113
data/tags.txt
@ -1,113 +0,0 @@
|
|||||||
A
|
|
||||||
ABBR
|
|
||||||
ADDRESS
|
|
||||||
AREA
|
|
||||||
AUDIO
|
|
||||||
B
|
|
||||||
BASE
|
|
||||||
BDI
|
|
||||||
BDO
|
|
||||||
BLOCKQUOTE
|
|
||||||
BODY
|
|
||||||
BR
|
|
||||||
BUTTON
|
|
||||||
CANVAS
|
|
||||||
CAPTION
|
|
||||||
CITE
|
|
||||||
CODE
|
|
||||||
COL
|
|
||||||
COLGROUP
|
|
||||||
DATA
|
|
||||||
DATALIST
|
|
||||||
DD
|
|
||||||
DEL
|
|
||||||
DETAILS
|
|
||||||
DETAILS-MENU
|
|
||||||
DEVELOPMENT-MENU
|
|
||||||
DFN
|
|
||||||
DL
|
|
||||||
DT
|
|
||||||
EM
|
|
||||||
EMBED
|
|
||||||
FIELDSET
|
|
||||||
FIGCAPTION
|
|
||||||
FIGURE
|
|
||||||
FOOTER
|
|
||||||
G-EMOJI
|
|
||||||
H1
|
|
||||||
H2
|
|
||||||
H3
|
|
||||||
H4
|
|
||||||
H5
|
|
||||||
H6
|
|
||||||
HEAD
|
|
||||||
HEADER
|
|
||||||
HGROUP
|
|
||||||
HR
|
|
||||||
HTML
|
|
||||||
I
|
|
||||||
IFRAME
|
|
||||||
IMG
|
|
||||||
INCLUDE-FRAGMENT
|
|
||||||
INPUT
|
|
||||||
INS
|
|
||||||
KBD
|
|
||||||
LABEL
|
|
||||||
LEGEND
|
|
||||||
LI
|
|
||||||
LINK
|
|
||||||
MAIN
|
|
||||||
MAP
|
|
||||||
MARK
|
|
||||||
MENU
|
|
||||||
META
|
|
||||||
METER
|
|
||||||
NAV
|
|
||||||
NOSCRIPT
|
|
||||||
OBJECT
|
|
||||||
OL
|
|
||||||
OPTGROUP
|
|
||||||
OPTION
|
|
||||||
OUTPUT
|
|
||||||
P
|
|
||||||
PICTURE
|
|
||||||
PRE
|
|
||||||
PROGRESS
|
|
||||||
Q
|
|
||||||
RELATIVE-TIME
|
|
||||||
RP
|
|
||||||
RT
|
|
||||||
RUBY
|
|
||||||
S
|
|
||||||
SAMP
|
|
||||||
SCRIPT
|
|
||||||
SEARCH
|
|
||||||
SELECT
|
|
||||||
SLOT
|
|
||||||
SMALL
|
|
||||||
SOURCE
|
|
||||||
SPAN
|
|
||||||
STRONG
|
|
||||||
STYLE
|
|
||||||
SUB
|
|
||||||
SUMMARY
|
|
||||||
SUP
|
|
||||||
SVG
|
|
||||||
TASK-LISTS
|
|
||||||
TBODY
|
|
||||||
TD
|
|
||||||
TEMPLATE
|
|
||||||
TEXTAREA
|
|
||||||
TFOOT
|
|
||||||
TH
|
|
||||||
THEAD
|
|
||||||
TIME
|
|
||||||
TITLE
|
|
||||||
TOOL-TIP
|
|
||||||
TR
|
|
||||||
TRACK
|
|
||||||
U
|
|
||||||
UL
|
|
||||||
VAR
|
|
||||||
VIDEO
|
|
||||||
WBR
|
|
@ -2,6 +2,9 @@
|
|||||||
"appDesc": {
|
"appDesc": {
|
||||||
"message": "Hat jemand Dialoge zur Cookie-Zustimmung gesagt? 😋"
|
"message": "Hat jemand Dialoge zur Cookie-Zustimmung gesagt? 😋"
|
||||||
},
|
},
|
||||||
|
"contextMenu_issueOption": {
|
||||||
|
"message": "Folgen Sie diesem Problem in GitHub"
|
||||||
|
},
|
||||||
"contextMenu_reportOption": {
|
"contextMenu_reportOption": {
|
||||||
"message": "Diese Website melden"
|
"message": "Diese Website melden"
|
||||||
},
|
},
|
||||||
@ -60,7 +63,7 @@
|
|||||||
"message": "Popup ist aufgetaucht"
|
"message": "Popup ist aufgetaucht"
|
||||||
},
|
},
|
||||||
"reportDialog_submitExtraText": {
|
"reportDialog_submitExtraText": {
|
||||||
"message": "Wir empfehlen Ihnen dringend, die Erweiterung auf dieser Website zu deaktivieren, bis wir das Problem behoben haben."
|
"message": "Während wir daran arbeiten, können Sie diese Website zur Ausschlussliste in den Erweiterungseinstellungen hinzufügen oder die Erweiterung für diese Website einfach deaktivieren, indem Sie auf das Erweiterungssymbol in Ihrer Browser-Symbolleiste klicken"
|
||||||
},
|
},
|
||||||
"reportDialog_submitText": {
|
"reportDialog_submitText": {
|
||||||
"message": "Bericht gesendet!"
|
"message": "Bericht gesendet!"
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
"appDesc": {
|
"appDesc": {
|
||||||
"message": "Did someone say cookie consent dialogs? 😋"
|
"message": "Did someone say cookie consent dialogs? 😋"
|
||||||
},
|
},
|
||||||
|
"contextMenu_issueOption": {
|
||||||
|
"message": "Follow this issue in GitHub"
|
||||||
|
},
|
||||||
"contextMenu_reportOption": {
|
"contextMenu_reportOption": {
|
||||||
"message": "Report this website"
|
"message": "Report this website"
|
||||||
},
|
},
|
||||||
@ -60,7 +63,7 @@
|
|||||||
"message": "Popup showed up"
|
"message": "Popup showed up"
|
||||||
},
|
},
|
||||||
"reportDialog_submitExtraText": {
|
"reportDialog_submitExtraText": {
|
||||||
"message": "We strongly recommend you to turn off the extension in this site until we fix the issue"
|
"message": "While we are working on this, you can add this website to the exclusion list in the extension settings or just disable the extension for this website clicking on the extension icon in your browser toolbar"
|
||||||
},
|
},
|
||||||
"reportDialog_submitText": {
|
"reportDialog_submitText": {
|
||||||
"message": "Report sent!"
|
"message": "Report sent!"
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
"appDesc": {
|
"appDesc": {
|
||||||
"message": "¿Alguien dijo diálogos de consentimiento de cookies? 😋"
|
"message": "¿Alguien dijo diálogos de consentimiento de cookies? 😋"
|
||||||
},
|
},
|
||||||
|
"contextMenu_issueOption": {
|
||||||
|
"message": "Sigue este problema en GitHub"
|
||||||
|
},
|
||||||
"contextMenu_reportOption": {
|
"contextMenu_reportOption": {
|
||||||
"message": "Reportar este sitio web"
|
"message": "Reportar este sitio web"
|
||||||
},
|
},
|
||||||
@ -60,7 +63,7 @@
|
|||||||
"message": "Ha aparecido un diálogo"
|
"message": "Ha aparecido un diálogo"
|
||||||
},
|
},
|
||||||
"reportDialog_submitExtraText": {
|
"reportDialog_submitExtraText": {
|
||||||
"message": "Le recomendamos encarecidamente que desactive la extensión en este sitio hasta que solucionemos el problema"
|
"message": "Mientras trabajamos en esto, puedes agregar este sitio web a la lista de exclusión en la configuración de la extensión o simplemente deshabilitar la extensión para este sitio web haciendo clic en el ícono de la extensión en la barra de herramientas de tu navegador"
|
||||||
},
|
},
|
||||||
"reportDialog_submitText": {
|
"reportDialog_submitText": {
|
||||||
"message": "¡Reporte enviado!"
|
"message": "¡Reporte enviado!"
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
"appDesc": {
|
"appDesc": {
|
||||||
"message": "Quelqu'un a-t-il dit boîtes de dialogue de consentement aux cookies? 😋"
|
"message": "Quelqu'un a-t-il dit boîtes de dialogue de consentement aux cookies? 😋"
|
||||||
},
|
},
|
||||||
|
"contextMenu_issueOption": {
|
||||||
|
"message": "Suivez ce problème sur GitHub"
|
||||||
|
},
|
||||||
"contextMenu_reportOption": {
|
"contextMenu_reportOption": {
|
||||||
"message": "Signaler ce site web"
|
"message": "Signaler ce site web"
|
||||||
},
|
},
|
||||||
@ -60,7 +63,7 @@
|
|||||||
"message": "La fenêtre contextuelle s'est affichée"
|
"message": "La fenêtre contextuelle s'est affichée"
|
||||||
},
|
},
|
||||||
"reportDialog_submitExtraText": {
|
"reportDialog_submitExtraText": {
|
||||||
"message": "Nous vous recommandons vivement de désactiver l'extension sur ce site jusqu'à ce que nous résolvions le problème"
|
"message": "Pendant que nous travaillons sur cela, vous pouvez ajouter ce site Web à la liste d'exclusion dans les paramètres de l'extension ou simplement désactiver l'extension pour ce site Web en cliquant sur l'icône de l'extension dans la barre d'outils de votre navigateur"
|
||||||
},
|
},
|
||||||
"reportDialog_submitText": {
|
"reportDialog_submitText": {
|
||||||
"message": "Rapport envoyé!"
|
"message": "Rapport envoyé!"
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
"appDesc": {
|
"appDesc": {
|
||||||
"message": "Qualcuno ha detto finestre di dialogo per il consenso ai cookie? 😋"
|
"message": "Qualcuno ha detto finestre di dialogo per il consenso ai cookie? 😋"
|
||||||
},
|
},
|
||||||
|
"contextMenu_issueOption": {
|
||||||
|
"message": "Segui questo problema su GitHub"
|
||||||
|
},
|
||||||
"contextMenu_reportOption": {
|
"contextMenu_reportOption": {
|
||||||
"message": "Segnala questo sito web"
|
"message": "Segnala questo sito web"
|
||||||
},
|
},
|
||||||
@ -60,7 +63,7 @@
|
|||||||
"message": "È apparso il popup"
|
"message": "È apparso il popup"
|
||||||
},
|
},
|
||||||
"reportDialog_submitExtraText": {
|
"reportDialog_submitExtraText": {
|
||||||
"message": "Ti consigliamo vivamente di disattivare l'estensione in questo sito finché non risolviamo il problema"
|
"message": "Mentre stiamo lavorando su questo, puoi aggiungere questo sito web all'elenco di esclusione nelle impostazioni dell'estensione o semplicemente disabilitare l'estensione per questo sito web facendo clic sull'icona dell'estensione nella barra degli strumenti del tuo browser"
|
||||||
},
|
},
|
||||||
"reportDialog_submitText": {
|
"reportDialog_submitText": {
|
||||||
"message": "Rapporto inviato!"
|
"message": "Rapporto inviato!"
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
"appDesc": {
|
"appDesc": {
|
||||||
"message": "Alguém disse diálogos de consentimento de cookies? 😋"
|
"message": "Alguém disse diálogos de consentimento de cookies? 😋"
|
||||||
},
|
},
|
||||||
|
"contextMenu_issueOption": {
|
||||||
|
"message": "Siga esta questão no GitHub"
|
||||||
|
},
|
||||||
"contextMenu_reportOption": {
|
"contextMenu_reportOption": {
|
||||||
"message": "Denunciar este site"
|
"message": "Denunciar este site"
|
||||||
},
|
},
|
||||||
@ -60,7 +63,7 @@
|
|||||||
"message": "Apareceu um popup"
|
"message": "Apareceu um popup"
|
||||||
},
|
},
|
||||||
"reportDialog_submitExtraText": {
|
"reportDialog_submitExtraText": {
|
||||||
"message": "Recomendamos fortemente que você desative a extensão neste site até corrigirmos o problema"
|
"message": "Enquanto estamos trabalhando nisso, você pode adicionar este site à lista de exclusão nas configurações da extensão ou simplesmente desativar a extensão para este site clicando no ícone da extensão na barra de ferramentas do seu navegador"
|
||||||
},
|
},
|
||||||
"reportDialog_submitText": {
|
"reportDialog_submitText": {
|
||||||
"message": "Relatório enviado!"
|
"message": "Relatório enviado!"
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
"appDesc": {
|
"appDesc": {
|
||||||
"message": "Alguém disse diálogos de consentimento de cookies? 😋"
|
"message": "Alguém disse diálogos de consentimento de cookies? 😋"
|
||||||
},
|
},
|
||||||
|
"contextMenu_issueOption": {
|
||||||
|
"message": "Siga esta questão no GitHub"
|
||||||
|
},
|
||||||
"contextMenu_reportOption": {
|
"contextMenu_reportOption": {
|
||||||
"message": "Denunciar este site"
|
"message": "Denunciar este site"
|
||||||
},
|
},
|
||||||
@ -60,7 +63,7 @@
|
|||||||
"message": "Apareceu um popup"
|
"message": "Apareceu um popup"
|
||||||
},
|
},
|
||||||
"reportDialog_submitExtraText": {
|
"reportDialog_submitExtraText": {
|
||||||
"message": "Recomendamos fortemente que você desative a extensão neste site até corrigirmos o problema"
|
"message": "Enquanto estamos trabalhando nisso, você pode adicionar este site à lista de exclusão nas configurações da extensão ou simplesmente desativar a extensão para este site clicando no ícone da extensão na barra de ferramentas do seu navegador"
|
||||||
},
|
},
|
||||||
"reportDialog_submitText": {
|
"reportDialog_submitText": {
|
||||||
"message": "Relatório enviado!"
|
"message": "Relatório enviado!"
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
"appDesc": {
|
"appDesc": {
|
||||||
"message": "A spus cineva dialoguri de consimțământ pentru cookie? 😋"
|
"message": "A spus cineva dialoguri de consimțământ pentru cookie? 😋"
|
||||||
},
|
},
|
||||||
|
"contextMenu_issueOption": {
|
||||||
|
"message": "Urmați această problemă pe GitHub"
|
||||||
|
},
|
||||||
"contextMenu_reportOption": {
|
"contextMenu_reportOption": {
|
||||||
"message": "Raportați acest site web"
|
"message": "Raportați acest site web"
|
||||||
},
|
},
|
||||||
@ -60,7 +63,7 @@
|
|||||||
"message": "A apărut o fereastră pop-up"
|
"message": "A apărut o fereastră pop-up"
|
||||||
},
|
},
|
||||||
"reportDialog_submitExtraText": {
|
"reportDialog_submitExtraText": {
|
||||||
"message": "Îți recomandăm insistent să dezactivați extensia de pe acest site până când remediam problema"
|
"message": "În timp ce lucrăm la acest lucru, puteți adăuga acest site web la lista de excludere în setările extensiei sau pur și simplu dezactivați extensia pentru acest site web făcând clic pe iconița extensiei din bara de instrumente a browserului dvs"
|
||||||
},
|
},
|
||||||
"reportDialog_submitText": {
|
"reportDialog_submitText": {
|
||||||
"message": "Raport trimis!"
|
"message": "Raport trimis!"
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
"appDesc": {
|
"appDesc": {
|
||||||
"message": "Кто-то сказал диалоги согласия на использование файлов cookie? 😋"
|
"message": "Кто-то сказал диалоги согласия на использование файлов cookie? 😋"
|
||||||
},
|
},
|
||||||
|
"contextMenu_issueOption": {
|
||||||
|
"message": "Следите за этим вопросом в GitHub"
|
||||||
|
},
|
||||||
"contextMenu_reportOption": {
|
"contextMenu_reportOption": {
|
||||||
"message": "Сообщить об этом веб-сайте"
|
"message": "Сообщить об этом веб-сайте"
|
||||||
},
|
},
|
||||||
@ -60,7 +63,7 @@
|
|||||||
"message": "Появилось всплывающее окно"
|
"message": "Появилось всплывающее окно"
|
||||||
},
|
},
|
||||||
"reportDialog_submitExtraText": {
|
"reportDialog_submitExtraText": {
|
||||||
"message": "Настоятельно рекомендуем отключить расширение на этом сайте, пока мы не исправим проблему"
|
"message": "Пока мы над этим работаем, вы можете добавить этот сайт в список исключений в настройках расширения или просто отключить расширение для этого сайта, щелкнув по иконке расширения на панели инструментов вашего браузера)"
|
||||||
},
|
},
|
||||||
"reportDialog_submitText": {
|
"reportDialog_submitText": {
|
||||||
"message": "Отчет отправлен!"
|
"message": "Отчет отправлен!"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"manifest_version": 3,
|
"manifest_version": 3,
|
||||||
"name": "Cookie Dialog Monster",
|
"name": "Cookie Dialog Monster",
|
||||||
"version": "7.0.1",
|
"version": "7.0.2",
|
||||||
"default_locale": "en",
|
"default_locale": "en",
|
||||||
"description": "__MSG_appDesc__",
|
"description": "__MSG_appDesc__",
|
||||||
"icons": {
|
"icons": {
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* @description API URL
|
* @description API URL
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
const apiUrl = 'https://api.cookie-dialog-monster.com/rest/v2';
|
const apiUrl = 'https://api.cookie-dialog-monster.com/rest/v3';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description Context menu identifier
|
* @description Context menu identifier
|
||||||
@ -56,8 +56,9 @@ const refreshData = (callback) => {
|
|||||||
* @description Report active tab URL
|
* @description Report active tab URL
|
||||||
* @param {any} message
|
* @param {any} message
|
||||||
* @param {chrome.tabs.Tab} tab
|
* @param {chrome.tabs.Tab} tab
|
||||||
|
* @param {void?} callback
|
||||||
*/
|
*/
|
||||||
const report = async (message, tab) => {
|
const report = async (message, tab, callback) => {
|
||||||
try {
|
try {
|
||||||
const reason = message.reason;
|
const reason = message.reason;
|
||||||
const userAgent = message.userAgent;
|
const userAgent = message.userAgent;
|
||||||
@ -66,7 +67,8 @@ const report = async (message, tab) => {
|
|||||||
const headers = { 'Content-type': 'application/json' };
|
const headers = { 'Content-type': 'application/json' };
|
||||||
const url = `${apiUrl}/report/`;
|
const url = `${apiUrl}/report/`;
|
||||||
|
|
||||||
await fetch(url, { body, headers, method: 'POST' });
|
const response = await fetch(url, { body, headers, method: 'POST' });
|
||||||
|
callback?.((await response.json()).data);
|
||||||
} catch {
|
} catch {
|
||||||
console.error("Can't send report");
|
console.error("Can't send report");
|
||||||
}
|
}
|
||||||
@ -142,8 +144,9 @@ chrome.runtime.onMessage.addListener((message, sender, callback) => {
|
|||||||
storage.get(hostname, (state) => {
|
storage.get(hostname, (state) => {
|
||||||
callback(state[hostname] ?? { enabled: true });
|
callback(state[hostname] ?? { enabled: true });
|
||||||
});
|
});
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return true;
|
break;
|
||||||
case 'GET_TAB':
|
case 'GET_TAB':
|
||||||
chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => {
|
chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => {
|
||||||
callback(tabs[0]);
|
callback(tabs[0]);
|
||||||
@ -156,7 +159,8 @@ chrome.runtime.onMessage.addListener((message, sender, callback) => {
|
|||||||
break;
|
break;
|
||||||
case 'REPORT':
|
case 'REPORT':
|
||||||
if (tabId) {
|
if (tabId) {
|
||||||
report(message, sender.tab);
|
report(message, sender.tab, callback);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'SET_BADGE':
|
case 'SET_BADGE':
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
/**
|
||||||
|
* @typedef {Object} ExtensionData
|
||||||
|
* @property {string[]} commonWords
|
||||||
|
* @property {string[]} fixes
|
||||||
|
* @property {{ domains: string[], tags: string[] }} skips
|
||||||
|
* @property {{ classes: string[], selectors: string[] }} tokens
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description Attribute name
|
* @description Attribute name
|
||||||
*/
|
*/
|
||||||
@ -11,9 +19,9 @@ let count = 0;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @description Data properties
|
* @description Data properties
|
||||||
* @type {{ classes: string[], commonWords?: string[], fixes: string[], elements: string[], skips: string[], tags: string[] }?}
|
* @type {ExtensionData}
|
||||||
*/
|
*/
|
||||||
let data = null;
|
let { commonWords, fixes = [], skips, tokens } = {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description Shortcut to send messages to background script
|
* @description Shortcut to send messages to background script
|
||||||
@ -94,7 +102,7 @@ function clean(elements, skipMatch) {
|
|||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
function forceClean(element) {
|
function forceClean(element) {
|
||||||
const elements = [...element.querySelectorAll(data.elements)];
|
const elements = [...element.querySelectorAll(tokens.selectors)];
|
||||||
|
|
||||||
fix();
|
fix();
|
||||||
if (elements.length && !preview) clean(elements, true);
|
if (elements.length && !preview) clean(elements, true);
|
||||||
@ -157,6 +165,10 @@ function isInViewport(element) {
|
|||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
function match(element, skipMatch) {
|
function match(element, skipMatch) {
|
||||||
|
if (!tokens?.classes.length || !tokens?.selectors.length) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!(element instanceof HTMLElement) || !element.tagName) {
|
if (!(element instanceof HTMLElement) || !element.tagName) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -171,7 +183,7 @@ function match(element, skipMatch) {
|
|||||||
|
|
||||||
const tagName = element.tagName?.toUpperCase?.();
|
const tagName = element.tagName?.toUpperCase?.();
|
||||||
|
|
||||||
if (!data?.tags?.length || data.tags.includes(tagName)) {
|
if (skips.tags.includes(tagName)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -186,11 +198,11 @@ function match(element, skipMatch) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
(isDialog || isFakeDialog || isInViewport(element)) &&
|
(isDialog || isFakeDialog || isInViewport(element)) &&
|
||||||
(skipMatch || element.matches(data?.elements ?? []))
|
(skipMatch || element.matches(tokens.selectors))
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
// 2023-06-10: fix edge case force cleaning on children if no attributes
|
// 2023-06-10: fix edge case force cleaning on children if no attributes
|
||||||
if (data?.commonWords && element.outerHTML.match(new RegExp(data.commonWords.join('|')))) {
|
if (commonWords && element.outerHTML.match(new RegExp(commonWords.join('|')))) {
|
||||||
forceClean(element);
|
forceClean(element);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -203,14 +215,15 @@ function match(element, skipMatch) {
|
|||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
function fix() {
|
function fix() {
|
||||||
const backdrop = document.getElementsByClassName('modal-backdrop')[0];
|
const backdrops = document.getElementsByClassName('modal-backdrop');
|
||||||
const fixes = data?.fixes ?? [];
|
const domains = (skips?.domains ?? []).map((x) => (x.split('.').length < 3 ? `*${x}` : x));
|
||||||
const skips = (data?.skips ?? []).map((x) => (x.split('.').length < 3 ? `*${x}` : x));
|
|
||||||
|
|
||||||
if (backdrop?.children.length === 0 && backdrop.style.display !== 'none') {
|
for (const backdrop of backdrops) {
|
||||||
backdrop.style.setProperty('display', 'none');
|
if (backdrop.children.length === 0 && backdrop.style.display !== 'none') {
|
||||||
count += 1;
|
backdrop.style.setProperty('display', 'none');
|
||||||
dispatch({ type: 'SET_BADGE', value: `${count}` });
|
count += 1;
|
||||||
|
dispatch({ type: 'SET_BADGE', value: `${count}` });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const fix of fixes) {
|
for (const fix of fixes) {
|
||||||
@ -242,9 +255,9 @@ function fix() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (skips.every((x) => !hostname.match(x.replaceAll(/\*/g, '[^ ]*')))) {
|
if (domains.every((x) => !hostname.match(x.replaceAll(/\*/g, '[^ ]*')))) {
|
||||||
for (const element of [document.body, document.documentElement]) {
|
for (const element of [document.body, document.documentElement]) {
|
||||||
element?.classList.remove(...(data?.classes ?? []));
|
element?.classList.remove(...(tokens?.classes ?? []));
|
||||||
element?.style.setProperty('position', 'initial', 'important');
|
element?.style.setProperty('position', 'initial', 'important');
|
||||||
element?.style.setProperty('overflow-y', 'initial', 'important');
|
element?.style.setProperty('overflow-y', 'initial', 'important');
|
||||||
}
|
}
|
||||||
@ -300,7 +313,12 @@ async function setup(skipReadyStateHack) {
|
|||||||
dispatch({ type: 'ENABLE_POPUP' });
|
dispatch({ type: 'ENABLE_POPUP' });
|
||||||
|
|
||||||
if (state.enabled) {
|
if (state.enabled) {
|
||||||
data = await dispatch({ hostname, type: 'GET_DATA' });
|
const data = await dispatch({ hostname, type: 'GET_DATA' });
|
||||||
|
|
||||||
|
commonWords = data?.commonWords;
|
||||||
|
fixes = data?.fixes;
|
||||||
|
skips = data?.skips;
|
||||||
|
tokens = data?.tokens;
|
||||||
|
|
||||||
// 2023-06-13: hack to force clean when data request takes too long and there are no changes later
|
// 2023-06-13: hack to force clean when data request takes too long and there are no changes later
|
||||||
if (document.readyState === 'complete' && !skipReadyStateHack) {
|
if (document.readyState === 'complete' && !skipReadyStateHack) {
|
||||||
@ -320,10 +338,14 @@ async function setup(skipReadyStateHack) {
|
|||||||
* @type {MutationObserver}
|
* @type {MutationObserver}
|
||||||
*/
|
*/
|
||||||
const observer = new MutationObserver((mutations) => {
|
const observer = new MutationObserver((mutations) => {
|
||||||
const elements = mutations.map((mutation) => Array.from(mutation.addedNodes)).flat(1);
|
if (preview || !state.enabled || !tokens?.selectors.length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const elements = mutations.flatMap((mutation) => Array.from(mutation.addedNodes));
|
||||||
|
|
||||||
fix();
|
fix();
|
||||||
if (data?.elements.length && !preview) clean(elements);
|
clean(elements);
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -352,7 +374,7 @@ chrome.runtime.onMessage.addListener((message) => {
|
|||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
window.addEventListener('visibilitychange', async () => {
|
window.addEventListener('visibilitychange', async () => {
|
||||||
if (document.body?.children.length && !data) {
|
if (document.body?.children.length && !tokens) {
|
||||||
await setup(true);
|
await setup(true);
|
||||||
clean([...document.body.children]);
|
clean([...document.body.children]);
|
||||||
}
|
}
|
||||||
@ -386,7 +408,7 @@ window.addEventListener('pageshow', (event) => {
|
|||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
window.addEventListener(setupEventName, () => {
|
window.addEventListener(setupEventName, () => {
|
||||||
if (data?.elements.length && document.body?.children.length && state.enabled && !preview) {
|
if (document.body?.children.length && state.enabled && tokens?.selectors.length && !preview) {
|
||||||
if (readingTime() < 4) {
|
if (readingTime() < 4) {
|
||||||
forceClean(document.body);
|
forceClean(document.body);
|
||||||
} else {
|
} else {
|
||||||
|
@ -112,6 +112,9 @@ const reportDialogHtml = `
|
|||||||
<report-dialog-submit-extra-text>
|
<report-dialog-submit-extra-text>
|
||||||
${chrome.i18n.getMessage('reportDialog_submitExtraText')}
|
${chrome.i18n.getMessage('reportDialog_submitExtraText')}
|
||||||
</report-dialog-submit-extra-text>
|
</report-dialog-submit-extra-text>
|
||||||
|
<report-dialog-issue-button role="button" tabindex="0">
|
||||||
|
${chrome.i18n.getMessage('contextMenu_issueOption')}
|
||||||
|
</report-dialog-issue-button>
|
||||||
</report-dialog-submit-view>
|
</report-dialog-submit-view>
|
||||||
</report-dialog-body>
|
</report-dialog-body>
|
||||||
</dialog>
|
</dialog>
|
||||||
@ -121,25 +124,25 @@ const reportDialogHtml = `
|
|||||||
* @description Dialog close button click handler
|
* @description Dialog close button click handler
|
||||||
* @param {MouseEvent} event
|
* @param {MouseEvent} event
|
||||||
*/
|
*/
|
||||||
const closeButtonClickHandler = (event) => {
|
function closeButtonClickHandler(event) {
|
||||||
const dialog = document.getElementById(reportDialogId);
|
const dialog = document.getElementById(reportDialogId);
|
||||||
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
dialog?.remove();
|
dialog?.remove();
|
||||||
};
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description Hide report dialog
|
* @description Hide report dialog
|
||||||
*/
|
*/
|
||||||
const hideReportDialog = () => {
|
function hideReportDialog() {
|
||||||
document.getElementById(reportDialogId)?.remove();
|
document.getElementById(reportDialogId)?.remove();
|
||||||
};
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description Dialog radio input click handler
|
* @description Dialog radio input click handler
|
||||||
* @param {MouseEvent} event
|
* @param {MouseEvent} event
|
||||||
*/
|
*/
|
||||||
const radioClickHandler = (event) => {
|
function radioClickHandler(event) {
|
||||||
const dialog = document.getElementById(reportDialogId);
|
const dialog = document.getElementById(reportDialogId);
|
||||||
const radios = dialog.getElementsByTagName('report-dialog-radio');
|
const radios = dialog.getElementsByTagName('report-dialog-radio');
|
||||||
const submitButton = dialog?.getElementsByTagName('report-dialog-submit-button')[0];
|
const submitButton = dialog?.getElementsByTagName('report-dialog-submit-button')[0];
|
||||||
@ -152,12 +155,12 @@ const radioClickHandler = (event) => {
|
|||||||
event.currentTarget.setAttribute('aria-checked', 'true');
|
event.currentTarget.setAttribute('aria-checked', 'true');
|
||||||
submitButton.setAttribute('aria-disabled', 'false');
|
submitButton.setAttribute('aria-disabled', 'false');
|
||||||
submitButton.addEventListener('click', submitButtonClickHandler);
|
submitButton.addEventListener('click', submitButtonClickHandler);
|
||||||
};
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description Show report dialog
|
* @description Show report dialog
|
||||||
*/
|
*/
|
||||||
const showReportDialog = () => {
|
function showReportDialog() {
|
||||||
const parser = new DOMParser();
|
const parser = new DOMParser();
|
||||||
const result = parser.parseFromString(reportDialogHtml, 'text/html');
|
const result = parser.parseFromString(reportDialogHtml, 'text/html');
|
||||||
const dialog = result.body.firstElementChild;
|
const dialog = result.body.firstElementChild;
|
||||||
@ -181,26 +184,30 @@ const showReportDialog = () => {
|
|||||||
if (!document.getElementById('report-dialog-font')) {
|
if (!document.getElementById('report-dialog-font')) {
|
||||||
document.head.appendChild(link);
|
document.head.appendChild(link);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description Dialog submit button click handler
|
* @description Dialog submit button click handler
|
||||||
* @param {MouseEvent} event
|
* @param {MouseEvent} event
|
||||||
*/
|
*/
|
||||||
const submitButtonClickHandler = (event) => {
|
async function submitButtonClickHandler(event) {
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
const dialog = document.getElementById(reportDialogId);
|
const dialog = document.getElementById(reportDialogId);
|
||||||
const formView = dialog?.getElementsByTagName('report-dialog-form-view')[0];
|
const formView = dialog?.getElementsByTagName('report-dialog-form-view')[0];
|
||||||
|
const issueButton = dialog?.getElementsByTagName('report-dialog-issue-button')[0];
|
||||||
const option = dialog?.querySelector('report-dialog-radio[aria-checked="true"]');
|
const option = dialog?.querySelector('report-dialog-radio[aria-checked="true"]');
|
||||||
const reasonIndex = option?.dataset.value;
|
const reasonIndex = option?.dataset.value;
|
||||||
const reason = Number.isNaN(reasonIndex) ? 'Unknown' : reasons[reasonIndex];
|
const reason = Number.isNaN(reasonIndex) ? 'Unknown' : reasons[reasonIndex];
|
||||||
const submitView = dialog?.getElementsByTagName('report-dialog-submit-view')[0];
|
const submitView = dialog?.getElementsByTagName('report-dialog-submit-view')[0];
|
||||||
const userAgent = window.navigator.userAgent;
|
const userAgent = window.navigator.userAgent;
|
||||||
|
|
||||||
event.preventDefault();
|
const issueUrl = await dispatch({ userAgent, reason, type: 'REPORT' });
|
||||||
dispatch({ userAgent, reason, type: 'REPORT' });
|
|
||||||
formView?.setAttribute('hidden', 'true');
|
formView?.setAttribute('hidden', 'true');
|
||||||
|
issueButton?.addEventListener('click', () => window.open(issueUrl, '_blank'));
|
||||||
submitView?.removeAttribute('hidden');
|
submitView?.removeAttribute('hidden');
|
||||||
};
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description Listen to messages
|
* @description Listen to messages
|
||||||
|
@ -70,6 +70,18 @@ report-dialog-close-button:hover {
|
|||||||
background-color: var(--cookie-dialog-monster-color-white);
|
background-color: var(--cookie-dialog-monster-color-white);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
report-dialog-form {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
report-dialog-form-view {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
report-dialog-form-view[hidden] {
|
report-dialog-form-view[hidden] {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
@ -96,7 +108,6 @@ report-dialog-radio {
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
display: block;
|
display: block;
|
||||||
font-family: Inter, Arial, Helvetica, sans-serif;
|
font-family: Inter, Arial, Helvetica, sans-serif;
|
||||||
margin-top: 18px;
|
|
||||||
outline: none !important;
|
outline: none !important;
|
||||||
padding-left: 24px;
|
padding-left: 24px;
|
||||||
position: relative;
|
position: relative;
|
||||||
@ -148,8 +159,10 @@ report-dialog-radio:before {
|
|||||||
report-dialog-radio-group {
|
report-dialog-radio-group {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
gap: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
report-dialog-issue-button,
|
||||||
report-dialog-submit-button {
|
report-dialog-submit-button {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
background-color: var(--cookie-dialog-monster-color-secondary);
|
background-color: var(--cookie-dialog-monster-color-secondary);
|
||||||
@ -162,7 +175,6 @@ report-dialog-submit-button {
|
|||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
height: 39px;
|
height: 39px;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
margin-top: 24px;
|
|
||||||
outline: none !important;
|
outline: none !important;
|
||||||
padding: 8px 16px;
|
padding: 8px 16px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@ -170,12 +182,15 @@ report-dialog-submit-button {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
report-dialog-issue-button:focus,
|
||||||
|
report-dialog-issue-button:hover,
|
||||||
report-dialog-submit-button:focus,
|
report-dialog-submit-button:focus,
|
||||||
report-dialog-submit-button:hover {
|
report-dialog-submit-button:hover {
|
||||||
background-color: var(--cookie-dialog-monster-color-white);
|
background-color: var(--cookie-dialog-monster-color-white);
|
||||||
color: var(--cookie-dialog-monster-color-secondary);
|
color: var(--cookie-dialog-monster-color-secondary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
report-dialog-issue-button[aria-disabled='true'],
|
||||||
report-dialog-submit-button[aria-disabled='true'] {
|
report-dialog-submit-button[aria-disabled='true'] {
|
||||||
background-color: var(--cookie-dialog-monster-color-tertiary);
|
background-color: var(--cookie-dialog-monster-color-tertiary);
|
||||||
border: 1px solid var(--cookie-dialog-monster-color-tertiary);
|
border: 1px solid var(--cookie-dialog-monster-color-tertiary);
|
||||||
@ -186,18 +201,16 @@ report-dialog-submit-button[aria-disabled='true'] {
|
|||||||
report-dialog-submit-extra-text {
|
report-dialog-submit-extra-text {
|
||||||
font-family: inherit !important;
|
font-family: inherit !important;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
line-height: 14px;
|
line-height: 16px;
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
margin-top: 16px;
|
text-align: justify;
|
||||||
text-align: center;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
report-dialog-submit-text {
|
report-dialog-submit-text {
|
||||||
font-family: inherit !important;
|
font-family: inherit !important;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
line-height: 18px;
|
line-height: 20px;
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
margin-top: 24px;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -206,8 +219,9 @@ report-dialog-submit-view {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
font-family: Inter, Arial, Helvetica, sans-serif;
|
font-family: Inter, Arial, Helvetica, sans-serif;
|
||||||
|
gap: 24px;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
min-height: 269px;
|
margin-top: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
report-dialog-submit-view[hidden] {
|
report-dialog-submit-view[hidden] {
|
||||||
|
Loading…
Reference in New Issue
Block a user