MathRobin / Never-Consent

Never consent to any GDPR consent management platform
MIT License
255 stars 16 forks source link

Support for "Admiral" powered sites #96

Closed AlfredJKwack closed 2 years ago

AlfredJKwack commented 3 years ago

Hi,

It would be great if the plugin could support sites powered by Admiral Example site: https://www.dwell.com/

Screenshot 2021-10-18 at 20 32 21
MathRobin commented 3 years ago

great suggestion and thanks for the details. Sadly I've not anymore the time for maintaining this extension. I will probably remove it from the browsers stores and archieve this repo if i don't find a main contributor to replace me soon...

AlfredJKwack commented 2 years ago

If anyone ever picks this one up. A couple of intersesting observations with this one.

So the checkboxes are structured as follows:

<label class="Toggle__Label-sc-1gq6yqj-0 CUxxz">
     <input type="checkbox" style="border: 0px; clip: rect(0px, 0px, 0px, 0px); 
     height: 1px; width: 1px; margin: -1px; padding: 0px; overflow: hidden; position: absolute;">
     <span class="Toggle__Container-sc-1gq6yqj-1 dycmHo">
          <span class="Toggle__StyledToggle-sc-1gq6yqj-2 kpdzoh">
               <svg width="1em" height="1em" viewBox="0 0 12 9" fill="none" class="checkmark checked" aria-hidden="true"><rect x="1.5" y="3" width="6.364" height="2.121" rx="1" transform="rotate(45 1.5 3)" fill="currentColor"></rect><rect x="12" y="1.5" width="10.607" height="2.121" rx="1" transform="rotate(135 12 1.5)" fill="currentColor"></rect></svg>
          </span>
     </span>
     <span class="Text-azid7f-0 PartnersLayer__IABToggleText-tonkui-2 jIDGWj eSdtoC">Legitimate Interest</span></label>

Depending on how far down that looong list you've scrolled the follwing will give you a different answer.

document.querySelectorAll("label.CUxxz > input[type=checkbox]").length

As a result doing something like .click() on those checkboxes will not necessarily click all of them.


var inputs = document.querySelectorAll("label.CUxxz > input[type=checkbox]");
var j = 0;
for (var i=0; i < inputs.length; i++) {
    if (inputs[i].checked) {
        inputs[i].click();
        j++;
    }
}
console.log(j);

I don't know if that's relevant, but if it is I suspect that there's some notions of scrolling, elements being visible or in view, or lazy loading involved. It could be a purposeful means of combating tools like this plugin.

Interested in anyone's view on that.

MathRobin commented 2 years ago

Sadly I haven't time anymore to maintain. I decided to remove this extension from stores and archieve this repo. Many thanks to having try to help me. Many thanks again :heart: