diff --git a/.gitignore b/.gitignore index 5833e60..779ab5c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ .idea -bundle.zip +*.zip *.swp diff --git a/CHANGELOG.md b/CHANGELOG.md index 001c346..14f3c06 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# 1.5.1 + +## Bug fixes + + - TarteAuCitron broke Google Docs (issue #25) + # 1.5.0 ## Features diff --git a/manifest.json b/manifest.json index e7f69be..aaef85c 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "author": "Mathieu Kim Robin", "name": "Never-Consent", "description": "Never consent to any GDPR consent management platform", - "version": "1.5.0", + "version": "1.5.1", "icons": { "16": "assets/16.ico", "48": "assets/48.ico", diff --git a/src/nc.js b/src/nc.js index 004f200..328936e 100644 --- a/src/nc.js +++ b/src/nc.js @@ -50,69 +50,74 @@ let kickCmpmngr = 0; const kick = setInterval(function () { - // Didomi - if (!!window.Didomi) { - window.Didomi.setUserDisagreeToAll(); - clearInterval(kick); - } + try { + // Didomi + if (!!window.Didomi) { + window.Didomi.setUserDisagreeToAll(); + clearInterval(kick); + } - // consentmanager - if (!!window.cmpmngr) { - kickCmpmngr += 1; - window.cmpmngr.setConsentViaBtn(0); + // consentmanager + if (!!window.cmpmngr) { + kickCmpmngr += 1; + window.cmpmngr.setConsentViaBtn(0); - // Because they are like a man, they have to heard too much times "nope" to understand "nope" - if (5 === kickCmpmngr) { - clearInterval(kick); + // Because they are like a man, they have to heard too much times "nope" to understand "nope" + if (5 === kickCmpmngr) { + clearInterval(kick); + } } - } - // cookielawinfo - if (!!window.CLI && !!window.CLI.reject_close) { - CLI.reject_close(); - clearInterval(kick); - } + // cookielawinfo + if (!!window.CLI && !!window.CLI.reject_close) { + CLI.reject_close(); + clearInterval(kick); + } - // tarteaucitron - if (!!tarteaucitron) { - tarteaucitron.userInterface.respondAll(false); - clearInterval(kick); - } + // tarteaucitron + if (!!window.tarteaucitron) { + tarteaucitron.userInterface.respondAll(false); + clearInterval(kick); + } - // crownpeak - if (!!window.evidon) { - elClick('.evidon-consent-button-text'); - window.evidon.preferencesDialog.doWithdrawConsent(); - document.querySelector('#_evh-button').remove(); - clearInterval(kick); - } + // crownpeak + if (!!window.evidon) { + elClick('.evidon-consent-button-text'); + window.evidon.preferencesDialog.doWithdrawConsent(); + document.querySelector('#_evh-button').remove(); + clearInterval(kick); + } - // sirdata - if (!!window.Sddan && window.Sddan.cmpLoaded) { - elClick('.sd-cmp-1Q99t', () => { - elClick('.sd-cmp-2DJbe', () => { - elClick('.sd-cmp-2F7Cs', () => clearInterval(kick)); + // sirdata + if (!!window.Sddan && window.Sddan.cmpLoaded) { + elClick('.sd-cmp-1Q99t', () => { + elClick('.sd-cmp-2DJbe', () => { + elClick('.sd-cmp-2F7Cs', () => clearInterval(kick)); + }); }); - }); - } + } - // platform behind seloger.com, french flat search engine, still don't know wich one it is - if (!!window.theShield) { - fireEvent('#banner-cookie_customize', 'mousedown'); + // platform behind seloger.com, french flat search engine, still don't know wich one it is + if (!!window.theShield) { + fireEvent('#banner-cookie_customize', 'mousedown'); - const switchBoxes = document.querySelectorAll('.slshield-switch input'); + const switchBoxes = document.querySelectorAll('.slshield-switch input'); - if (switchBoxes.length) { - switchBoxes - .forEach(checkbox => { - if (checkbox.checked) { - checkbox.click(); - } - }); + if (switchBoxes.length) { + switchBoxes + .forEach(checkbox => { + if (checkbox.checked) { + checkbox.click(); + } + }); - elClick('.slshield-info__cta.slshield-info__cta-accept', () => clearInterval(kick)); + elClick('.slshield-info__cta.slshield-info__cta-accept', () => clearInterval(kick)); + } } + } catch (except) { + console.error('[extension:Never-Consent] encountered a problem, please open an issue here https://github.com/MathRobin/Never-Consent/issues'); + console.error('[extension:Never-Consent]', except); } }, 100);