widgetfactory / jce

JCE - A Content Editor for Joomla
https://www.joomlacontenteditor.net
GNU General Public License v2.0
35 stars 12 forks source link

JCE Media Box - Sometimes the popups won't open #107

Closed ChristineWk closed 2 years ago

ChristineWk commented 2 years ago

@ryandemmer

Have a look please to this thread: https://forum.joomla.de/thread/15318-jce-mediabox/ Thank you

To Reproduce

If you open a page with popups in the frontend, it happens very often and regularly that the popups don't work. In this case, the magnifying glass is also not displayed. If you refresh the page, it works again.

https://www.langeneggers.ch/grusskarte.html?view=rwcard&category_id=5&reWritetoSender=&sessionId=

It's reproducible

Joomla 4.0.6 and JCE Mediabox 2.1.2

Additional context

https://developers.google.com/web/updates/2016/08/removing-document-write

ryandemmer commented 2 years ago

If you open a page with popups in the frontend, it happens very often and regularly that the popups don't work. In this case, the magnifying glass is also not displayed. If you refresh the page, it works again.

When this does happen, it is because the JCE MediaBox scripts are not being loaded into the page. It is important to note that the MediaBox stylesheet is being loaded, as MediaBox uses the standard Joomla API to load its scripts, and there is nothing in the JCE MediaBox plugin preventing this load (as the stylesheet which is loaded is part of the same process), then the issue must be with something on your site.

Additional context https://developers.google.com/web/updates/2016/08/removing-document-write

I'm not sure why this is relevant. MediaBox does not use document.write

ryandemmer commented 2 years ago

After another look, I would suggest this is being caused by the template's caching mechanism. You should disable this, or set the Mediabox scripts to be skipped by the cache.

ChristineWk commented 2 years ago

Thank you for your investigation. We have forwarded your info into the thread. Concerning the document.write: we found out, it belongs to G ads.

We suggested to the user to switch off the compressing JS. or to add the Mediabox JS as an exception.

ChristineWk commented 2 years ago

@ryandemmer

User has switched off the compressing JS. Since then the error no longer occurs. Thank you for your help.