FIX: don't load adsbygoogle.js when adsense publisher id isn't set

This commit is contained in:
Neil Lalonde 2016-11-21 15:58:29 -05:00
parent da1d4e0063
commit de4a8366fc
1 changed files with 2 additions and 0 deletions

View File

@ -24,6 +24,8 @@ function splitHeightInt(value) {
// On each page change, the child is removed and elements part of Adsense's googleads are removed/undefined.
function changePage() {
if (!Discourse.SiteSettings.adsense_publisher_code) { return; }
const ads = document.getElementById("adsense_loader");
if (ads) {
ads.parentNode.removeChild(ads);