fix: do not select ins element inserted by Google and raising a adsbygoogle.push() error#192
fix: do not select ins element inserted by Google and raising a adsbygoogle.push() error#192jbmolle wants to merge 1 commit intonuxt-modules:mainfrom
Conversation
…sing a adsbygoogle.push() error
|
Please approve this change. I don't understand why is still pending. It's pretty urgent. This google-adsense module is completely obsolete right now. Close this project if you don't update it. |
|
@valere-hope Nobody stops you from patching this change until it is merged. I will do so as soon as I have time for it to revisit the PR. |
|
Ok, thank you. Sorry for my harshness but I lost a lot of time trying to solve issues with this module. It is promoted on nuxt3 official website but it is outdated. I also understand the fact that you have little time available since 7 months have passed since the request. So i'll try to find another solution. Thank you. |
I'll get it done by the end of the week 👍 |
It seems that Adsense script automatically insert an invisible ins element at the bottom of the page
So if we don't put any ads component on a page, the current onload script will find this ins (with className 'adsbygoogle') and try to call adsbygoogle.push with raises the error "All ins elements in the DOM with class=adsbygoogle already have ads in them."
I think this pull request fixes #156 and maybe #179
Also it works only when onPageLoad option is set to true.