Skip to content

Commit

Permalink
Disable refreshing of the parent slot from dfpenv
Browse files Browse the repository at this point in the history
  • Loading branch information
arelra committed Jul 30, 2024
1 parent 4ee4ccd commit 378d398
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/messenger/passback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { breakpoints } from '@guardian/source/foundations';
import { adSizes } from 'core/ad-sizes';
import type { RegisterListener } from 'core/messenger';
import { getCurrentBreakpoint } from 'lib/detect/detect-breakpoint';
import { getAdvertById } from 'lib/dfp/get-advert-by-id';
import fastdom from 'utils/fastdom-promise';
import { adSlotIdPrefix } from '../../lib/dfp/dfp-env-globals';

Expand Down Expand Up @@ -167,10 +168,12 @@ const init = (register: RegisterListener): void => {
iFrameContainer.style.visibility = 'hidden';
// Allows passback slot to position absolutely over the parent slot
slotElement.style.position = 'relative';
// Remove any outstream styling for this slot
// Remove any outstream styling for the parent slot
slotElement.classList.remove('ad-slot--outstream');
// Prevent refreshing of the parent slot
slotElement.setAttribute('data-refresh', 'false');
const advert = getAdvertById(slotElement.id);
if (advert) advert.shouldRefresh = false;
});

/**
Expand Down

0 comments on commit 378d398

Please sign in to comment.