Closed halaei closed 4 years ago
I also guess v-else is missing here:
<script2
v-if="isNonPersonalizedAds"
type="text/javascript">
(adsbygoogle = window.adsbygoogle || []).push({}).requestNonPersonalizedAds = 1;
</script2>
<script2 type="text/javascript"> // v-else missing???
(adsbygoogle = window.adsbygoogle || []).push({});
</script2>
I don't think the memory leak relates to loading scripts multiple times. My guess is adsens isn't compatible with single page apps and we should use Google ad manager instead.
Closed for now
I am using InFeedAdsense and Adsense components. Using a small test to programmatically navigate between app pages with ads, I find it has memory leaks. Over time, it makes a lot of detached dom elements that can't be garbage collected. It seams every time a component is created, 2 listeners are added to window, listening to load and message events. But they are never removed. I am wondering if '//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js' should be added inside html only once an not once per component?