Lazy loading banners

Created on 11 September 2019, almost 6 years ago
Updated 20 July 2025, 8 days ago

In the file dfp_googletag.cmd.js

if (inView || !Drupal.settings.dfpLazyLoad || Drupal.settings.dfpTags[index].out_of_page) {

(line 275)

The value of Drupal.settings.dfpLazyLoad is undefined.

That means that the negation always evaluates as true, and thus the conditional is always true.

Then all banners are loaded, even if the inView function finds them out of the viewport.

The patch I am proposing removes that part of the conditional

if (inView || Drupal.settings.dfpTags[index].out_of_page) {
πŸ› Bug report
Status

Closed: outdated

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States mindbet

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024