Consent-O-Matic icon indicating copy to clipboard operation
Consent-O-Matic copied to clipboard

Help for rule for Dutch site: nl.hardware.info

Open lenwar opened this issue 1 year ago • 1 comments

Hi,

I'm trying to work out a rule for nl.hardware.info. It's working in the basis, but I can't seem to get the category E: content-selection working.

This is what I have so far:

{
    "$schema": "https://raw.githubusercontent.com/cavi-au/Consent-O-Matic/master/rules.schema.json",
    "Hardware.info-test": {
        "detectors": [
            {
                "presentMatcher": [
                    {
                        "type": "css",
                        "target": {
                            "selector": "div#oreo",
                            "displayFilter": true
                        }
                    }
                ],
                "showingMatcher": [
                    {
                        "type": "css",
                        "target": {
                            "selector": "div#oreo:not(.koekie_bar_inactive)"
                        }
                    }
                ]
            }
        ],
        "methods": [
            {
                "name": "HIDE_CMP"
            },
            {
                "action": {
                    "type": "click",
                    "target": {
                        "selector": "div#oreo button[data-action=\"configure\"]"
                    }
                },
                "name": "OPEN_OPTIONS"
            },
            {
                "action": {
                    "type": "list",
                    "actions": [
                        {
                            "type": "consent",
                            "consents": [
                                {
                                    "matcher": {
                                        "type": "css",
                                        "target": {
                                            "selector": "div#oreo div.explanation.relevantAds .toggleSwitch:not(.on)"
                                        }
                                    },
                                    "toggleAction": {
                                        "type": "click",
                                        "target": {
                                            "selector": "div#oreo div.explanation.relevantAds .toggleSwitch"
                                        }
                                    },
                                    "type": "F"
                                }
                            ]
                        },
                        {
                            "type": "consent",
                            "consents": [
                                {
                                    "matcher": {
                                        "type": "css",
                                        "target": {
                                            "selector": "div#oreo div.explanation .toggleSwitch:not(.on)"
                                        }
                                    },
                                    "toggleAction": {
                                        "type": "click",
                                        "target": {
                                            "selector": "div#oreo div.explanation div[data-action=\"toggleAll\"]"
                                        }
                                    },
                                    "type": "E"
                                }
                            ]
                        }
                    ]
                },
                "name": "DO_CONSENT"
            },
            {
                "action": {
                    "type": "click",
                    "target": {
                        "selector": "div#oreo button[data-action=\"saveConfigured\"]"
                    }
                },
                "name": "SAVE_CONSENT"
            },
            {
                "name": "UTILITY"
            }
        ]
    }
}

lenwar avatar Mar 31 '23 12:03 lenwar

You are matching on "div.explanation .toggleswitch" which is ambiguous. It also matches on the disabled slider for "Functioneel en analytisch" since its first it matches on that, which can be seen if you have enabled paintMatchers in the Dev menu. Check Pull request #270 for changes and the hide rule is added

AUToelboell avatar Apr 16 '23 09:04 AUToelboell