diff --git a/3p/integration.js b/3p/integration.js index 4daf7c0421c5..6ddd8e821bf1 100644 --- a/3p/integration.js +++ b/3p/integration.js @@ -228,11 +228,12 @@ window.draw3p = function(opt_configCallback, opt_allowed3pTypes, // This only actually works for ads. const initialIntersection = window.context.initialIntersection; window.context.observeIntersection = cb => { - observeIntersection(cb); + const unlisten = observeIntersection(cb); // Call the callback with the value that was transmitted when the // iframe was drawn. Called in nextTick, so that callers don't // have to specially handle the sync case. nextTick(window, () => cb([initialIntersection])); + return unlisten; }; window.context.onResizeSuccess = onResizeSuccess; window.context.onResizeDenied = onResizeDenied;