Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Site breakage: correctiv.org #467

Open
1 of 3 tasks
EvilWatermelon opened this issue Jul 26, 2024 · 0 comments
Open
1 of 3 tasks

Site breakage: correctiv.org #467

EvilWatermelon opened this issue Jul 26, 2024 · 0 comments

Comments

@EvilWatermelon
Copy link

EvilWatermelon commented Jul 26, 2024

Description

The popup on [site]

  • is not detected
  • is not dismissed properly
  • other (elaborate below)

Tested on

emulateDevice: {
             viewport: {height: 1440, width: 800},
             userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"
},

Tested from country:
Puppeteer Geolocation for Washington DC

Autoconsent version:

Screenshot (optional)

I'm getting

CMP error TypeError: Cannot read properties of null (reading 'isHidingRule')
    at TabConsent.doOptIn (/home/isumis/Dokumente/blacklight-collector/node_modules/@duckduckgo/autoconsent/dist/autoconsent.puppet.js:588:28)
    at /home/isumis/Dokumente/blacklight-collector/src/collector.ts:201:29
couldnt load json safely undefined
couldnt load json safely undefined
couldnt load json safely undefined
couldnt load json safely undefined
couldnt load json safely undefined
couldnt load json safely undefined
couldnt load json safely undefined
couldnt load json safely undefined
couldnt load json safely undefined

Using the following code

const autoconsent = require('@duckduckgo/autoconsent/dist/autoconsent.puppet.js');
const extraRules = require('@duckduckgo/autoconsent/rules/rules.json');

const consentomatic = extraRules.consentomatic;
const rules = [
    ...autoconsent.rules,
    ...Object.keys(consentomatic).map(name => new autoconsent.ConsentOMaticCMP(`com_${name}`, consentomatic[name])),
    ...extraRules.autoconsent.map(spec => autoconsent.createAutoCMP(spec)),
];

page.once('load', async () => {
         const tab = autoconsent.attachToPage(page, url, rules, 10);
         try {
                await tab.checked;
                await tab.doOptIn();
            	} catch (e) {
                	console.warn(`CMP error`, e);
            	}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant