mirror of
https://github.com/discourse/discourse-adplugin.git
synced 2025-07-08 22:22:44 +00:00
FIX: don't load adsbygoogle.js when adsense publisher id isn't set
This commit is contained in:
parent
da1d4e0063
commit
de4a8366fc
@ -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.
|
// On each page change, the child is removed and elements part of Adsense's googleads are removed/undefined.
|
||||||
function changePage() {
|
function changePage() {
|
||||||
|
if (!Discourse.SiteSettings.adsense_publisher_code) { return; }
|
||||||
|
|
||||||
const ads = document.getElementById("adsense_loader");
|
const ads = document.getElementById("adsense_loader");
|
||||||
if (ads) {
|
if (ads) {
|
||||||
ads.parentNode.removeChild(ads);
|
ads.parentNode.removeChild(ads);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user