You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OneTrust is by far the most common CMP, but right now it contains huge delays (seconds), so opting out works, but is super slow. This sometimes blocks the website for a few seconds. We should review it and see if it can be optimized.
Here's what I found last time I checked:
After clicking the options button, we need to wait until the pop-up is visible. This is tricky (e.g. on stackoverflow.com) as our waitForVisible() function fails there, so we resort to really long unconditional delays, which cause most of the slow down.
As far as I know, there's no universal way to check the element "visibility" in DOM. We can probably come up with a hack specifically for stackoverflow, but we should be careful not to break the rule on other sites. Some example sites can be found in the monthly crawl data and the test files.
The text was updated successfully, but these errors were encountered:
Hello, I spent some time looking into this and wanted to share my observation.
As OneTrust waits with waitForElement('#onetrust-consent-sdk', 2000)here and given onetrust-consent-sdk is the parent div for consent selection related elements, it seems that because this div is already present when the site loads, the process does not listen for changes after clicking the options button and immediately proceeds to select the checkboxes, submit and occasionally fails.
Instead of waitForElement(), we could consider using waitForVisible() on #onetrust-pc-sdk. This is the div that shows up on clicking the options button ("Customize Settings") and encapsulates pop-up related elements.
Using this would also eliminate the need to wait for save-preferences button here and the unconditional delays as all the checkboxes and save button are part of a child div - which is expected to be visible if the parent div is visible. I see similar behavior for other sites using this CMP like technologyreview.com.
I tested this change on my local and it works fine. But I was not able to reproduce the issues for which the unconditional delays were added (for example the popup still being visible after consent was denied successfully), so it is difficult to the test that behavior with this change.
Also, as some sites like stackoverflow.com are providing a "Reject All/Necessary Only" option upfront, this optimization might not be required in future.
OneTrust is by far the most common CMP, but right now it contains huge delays (seconds), so opting out works, but is super slow. This sometimes blocks the website for a few seconds. We should review it and see if it can be optimized.
Here's what I found last time I checked:
After clicking the options button, we need to wait until the pop-up is visible. This is tricky (e.g. on stackoverflow.com) as our
waitForVisible()
function fails there, so we resort to really long unconditional delays, which cause most of the slow down.As far as I know, there's no universal way to check the element "visibility" in DOM. We can probably come up with a hack specifically for stackoverflow, but we should be careful not to break the rule on other sites. Some example sites can be found in the monthly crawl data and the test files.
The text was updated successfully, but these errors were encountered: