Prevent images from being auto-blocked by OneTrust
What does this MR do and why?
Adds a data-ot-ignore
attribute to images which are served from our own domain. This might resolve https://gitlab.com/gitlab-org/gitlab-docs/-/issues/1750.
See also:
- https://gitlab.com/gitlab-org/gitlab-docs/-/issues/1750#note_1729576328
- https://my.onetrust.com/articles/en_US/Knowledge/UUID-71e7d0a8-03d8-e272-e683-72cadded2ecf
Screenshots, screen recordings, or links to review app
N/A (no visual changes, and analytics scripts do not run on the review app)
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
-
Configure a local GitLab Docs environment: https://gitlab.com/gitlab-org/gitlab-docs/-/blob/main/doc/setup.md. -
Compile the site with environment variables to include analytics scripts:
make clean && NANOC_ENV="production" CI_DEFAULT_BRANCH="main" CI_COMMIT_REF_NAME="main" GITLAB_ANALYTICS_HOST="https://collector.prod-1.gl-product-analytics.com" GITLAB_ANALYTICS_ID="e1c8d446-8edf-46fa-9e6a-9f964b8675c8" make compile
-
Verify images load as usual. Here's a page with several images: http://127.0.0.1:3000/ee/tutorials/left_sidebar/ -
Using browser devtools, verify images have a data-ot-ignore
attribute:
Merge request acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this merge request.
Closes #1750
Edited by Sarah German