URL: https://fdb.pl/#
Browser / Version: Firefox Mobile 71.0
Operating System: Android
Tested Another Browser: Yes
Problem type: Site is not usable
Description: the cookies info can't be closed, makes the site unusable
Steps to Reproduce:
Browser Configuration
_From webcompat.com with 鉂わ笍_
Thanks for the report, I was able to reproduce the issue.

Note:
Affected area:
<a class="btn btn-primary" id="consent-accept" href="#">Zgadzam si臋</a>
Console:

Tested with:
Browser / Version: Firefox Nightly 68.4a1 (2020-01-03) ,Firefox Preview Nightly 200105 (馃: 73.0a1-20200104094647)
Operating System: Huawei P20 Lite (Android 8.0.0) - 1080 x 2280 pixels, 19:9 ratio (~432 ppi density), Samsung Galaxy S7 Edge (Android 8.0.0) - Resolution 1440 x 2560 pixels (~534 ppi pixel density)
Moving to Needsdiagnosis for further investigation.
This is a regression https://bugzilla.mozilla.org/show_bug.cgi?id=1583700. Setting browser.tabs.documentchannel to false makes this work. Trying to figure out the cause..
DocumentChannel is only enabled on desktop but the issue is reproducible on mobile as well. Even though this is a regression (on desktop), the reason seems to be a timing issue.
In cases where it's not working __cmp function from here:
t.prototype.getVendorList = function (t) {
return this.vendorList ? t ? t(this.vendorList) : void 0 : __cmp('getVendorList', null, (e = this, function (n) {
if (e.vendorList = n, t) return t(e.vendorList)
}));
var e
},
is defined as global cmp:
function defineCmp() {
return function(command, parameter, callback) {
console.log("CMP", command, parameter, callback)
if (command === 'ping') {
handlePing(callback);
} else {
let commandEntry = {
command: command,
parameter: parameter,
callback: callback
};
commandCollection.push(commandEntry);
}
}
}
let cmp = defineCmp();
However in cases where it's working, __cmp is a completely different function.
There is this script on the main page that checks whether document.body exsits every 5 ms and inserts an iframe.
function addCmpLocatorIframe() {
if (!(document.getElementsByName('__cmpLocator').length > 0)) {
if (document.body) {
let frame = document.createElement('iframe');
frame.style.display = 'none';
frame.name = '__cmpLocator';
document.body.appendChild(frame);
} else {
setTimeout(addCmpLocatorIframe, 5);
}
}
}
...
addCmpLocatorIframe();
At the same time there is this chunk of code in https://fdb.pl/assets/packs/js/cmp-2a5658a9f4bd854f9aef.js which seems to be doing a similar thing except it doesn't check whether document.body exists:
var o = function (e) {
var n = e.dom;
return Promise.resolve().then(function () {
return n.getElementsByName('__cmpLocator')
}).then(function (e) {
if (e && e.length) return e[0];
var t = n.createElement('iframe');
return t.style.display = 'none',
t.name = '__cmpLocator',
n.body.appendChild(t),
t
})
};
so in cases where the button is broken, n.body.appendChild(t) throws an error since at the time document is not fully loaded. That causes this chain of promises to not resolve:
return Promise.resolve().then(function() {
return Promise.all([new r.default({
container: u.default.context({
config: t,
window: n
})
}).commandConsumer(), (0,
a.default)({
dom: n.document
})])
}).then(function(e) {
var t = e[0];
e[1];
return (0,
i.default)({
cmp: t,
window: n
})
}).then(function() {
return (0,
s.default)({
window: n,
name: "cmpReady"
})
})
Where this part is responsible for setting a new function expression for cmp:
var t = e[0];
e[1];
return (0,
i.default)({
cmp: t,
window: n
})
So in cases where it is broken, this code is unreachable because of the above error.
Given that the iframe will be inserted in addCmpLocatorIframe and it's not being used in the above chunk of code (e[1]; ) the site could perhaps add a check whether n.body exists, something like :
.then(function (e) {
if (e && e.length) return e[0];
if( n.body) {
var t = n.createElement('iframe');
return t.style.display = 'none',
t.name = '__cmpLocator',
n.body.appendChild(t),
t
}
})
Though it's hard to tell what the implications of that would be. The site should change the code to make sure there are no race conditions, so I'll move this to needscontact
It seems they have a dedicated "Suggestions" forum at https://feedback.userreport.com/e26cd8d9-3d45-4a47-96b3-995858ed0ea3/#ideas/popular , accessible from the "Sugestie" link at the site's header.
Emails are also available but commonly for press and advertisement purposes.
Thanks @reinhart1010. I've left a comment https://feedback.userreport.com/e26cd8d9-3d45-4a47-96b3-995858ed0ea3/#idea/281208
Hi,
I'm fdb.pl author. For GDPR we use https://github.com/scm-spain/boros-CMP.
For temporary solution I moved cmp at bottom page to not have race conditoon if body exists or not. From my first tests if seems works ok now.
Thanks for this bug report!
After retesting the issue I confirm that the issue has been fixed.
I was able to close the cookie prompt.

Tested with:
Browser / Version:Firefox Nightly 200830(馃 82.0a1-20200827093043)
Operating System: OnePlus6 (Android 10) - 1080 x 2280 pixels (~402 ppi pixel density)
Closing the issue as fixed.
Most helpful comment
Hi,
I'm fdb.pl author. For GDPR we use https://github.com/scm-spain/boros-CMP.
For temporary solution I moved cmp at bottom page to not have race conditoon if body exists or not. From my first tests if seems works ok now.
Thanks for this bug report!