Experiencing a 401 Unauthorized Error During Update?

If you're seeing a 401 Unauthorized error when trying to update your Joomla extension, it's likely due to our new two-factor authentication (2FA) security measure for your Download ID.
To resolve this, check your email (Spam folder?) for a message to approve your server or device, or read our detailed blog post here( onlinecommunityhub.nl/best-practice/new-...-extension-downloads) to understand the steps involved. This will guide you through approving your server for future updates.

No bug ochJSsocials does not work in Chrome Based browsers

More
7 months 1 day ago #2908 by Alex Baillie
Recently we upgraded to the latest ochJSsocials and since then I am only able to see the share buttons in FireFox, but not in a chrome based browser like chrome or edge. Is this an issue on our side or are you able to replicate it? I am sending a sample page and screenshots in the private message.

Please Log in to join the conversation.

More
7 months 22 hours ago #2912 by Ruud van Lent
Replied by Ruud van Lent on topic ochJSsocials does not work in Chrome Based browsers
Hi Alex,
thanks for reaching out.
When looking at the page provided I can confirm that the buttons are visible in FF and not in Chrome.
When looking at the browser console in Chrome I see that there is an error: jQuery.Deferred exception: jQuery(...).jsSocials is not a function

My quess here is that you have enabled some sort of optimization to the page where scripts are deferred but not in the regular way (but via a script?)

When looking at the page source I see the following code for scripts (not just jssocials):
Code:
<script src="/media/plg_content_ochjssocials/jssocials/js/jssocials.min.js?18be45" defer type="3cf67d8be98ce07c36465812-text/javascript"></script>

the type set is not correct as that should according to web standards be text-javascript and not what it is now (some custom type).

If you are using a component or plugin for optimizing, can you disable that to see if it then works again?
If so, can you exclude jssocials from this optimization?

from trying to analyze this from the page source I think it is caused by rocket-loader?
Code:
<script src="/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js" data-cf-settings="3cf67d8be98ce07c36465812-|49" defer></script>

Please Log in to join the conversation.

More
7 months 21 hours ago #2913 by Alex Baillie
Replied by Alex Baillie on topic ochJSsocials does not work in Chrome Based browsers
Hi Ruud,You are correct; the issue is caused by Rocket Loader. Has anything changed recently that could be causing this? I've always used Rocket Loader by default without any problems with ochJSsocials before.Additionally, could you consider adding an option in ochJSsocials to include the
Code:
data-cfasync="false"
attribute in the ochJSsocials script tag in a future update? This would make Rocket Loader ignore the script. While this isn't an ideal solution, it would allow customers to use both ochJSsocials and Rocket Loader simultaneously.

Thank you!

Alex

Please Log in to join the conversation.

More
7 months 19 hours ago #2918 by Ruud van Lent
Replied by Ruud van Lent on topic ochJSsocials does not work in Chrome Based browsers
I think this is a 'bug' in rocketloader and should be fixed there. I think this bug was triggered with a chrome update (because FireFox still works correct)

Is it possible in rocketloader to exclude specific scripts (I know other optimizing tools allow this)?

Please Log in to join the conversation.

More
7 months 18 hours ago #2920 by Alex Baillie
Replied by Alex Baillie on topic ochJSsocials does not work in Chrome Based browsers

I think this is a 'bug' in rocketloader and should be fixed there. I think this bug was triggered with a chrome update

Good point, I will open a ticket with CloudFlare.

As far as excluding scripts. Cloudflare does that only on a page level. In order to exclude a script it needs to be done via the method I suggested earlier (add data-cfasync="false" to the script tag). I also know some Joomla extension developers that create a Rocket Loader compatibility switch in their extension to be able to use it with Rocket Loader, so in other words to include and not exclude it from Rocket Loader. But, I do not know what it actually does.

Please Log in to join the conversation.

More
6 months 4 weeks ago #2921 by Ruud van Lent
Replied by Ruud van Lent on topic ochJSsocials does not work in Chrome Based browsers
Hi Alex,

Thing here is, that when you add that data attribute to the script element, it also stops loading on FireFox. Therefore this is not an option for me to add this to the plugin itself (as said; this should be fixed where the root cause is > the jssocials script is a regular script depending on jquery being loaded so if this is causing an issue specifically in chrome, in combination with cloudflare then there are likely other scripts having the same issue)

If you want to add the data attribute yourself you need to change the following file: ./media/plg_content_ochjssocials/joomla.asset.json

and change this:
Code:
        {             "name": "plg_content_ochjssocials.jssocials",             "description": "The file containing the jssocials script for this plugin.",             "type": "script",             "uri": "plg_content_ochjssocials/jssocials/jssocials.min.js",             "attributes": {                 "defer": true             },             "dependencies": ["core", "jquery"]         },

to this:
Code:
        {             "name": "plg_content_ochjssocials.jssocials",             "description": "The file containing the jssocials script for this plugin.",             "type": "script",             "uri": "plg_content_ochjssocials/jssocials/jssocials.min.js",             "attributes": {                 "defer": true,                 "data-cfasync": "false"             },             "dependencies": ["core", "jquery"]         },

so basically just the attribute. Note that JSON is not 'forgiving', so forgetting a , or adding an additional one will crash things on your site!

Please Log in to join the conversation.

More
6 months 4 weeks ago #2924 by Alex Baillie
Replied by Alex Baillie on topic ochJSsocials does not work in Chrome Based browsers
Hi Ruud,

Thanks for letting me know the code and workaround. It will help me a lot.

About:

Thing here is, that when you add that data attribute to the script element, it also stops loading on FireFox


It should not be included in Firefox as well. I was not suggesting it as a fix to the current issue, but rather to give your clients a choice to include the ochJSsocials script in Rocket Loader or not. There might be other scenarios someone would not want to include it in Rocket Loader.

Please Log in to join the conversation.

More
6 months 4 weeks ago #2925 by Ruud van Lent
Replied by Ruud van Lent on topic ochJSsocials does not work in Chrome Based browsers
It is not feasible to differentiate between browser vendors: e.g. what should we do with caching of the pages? when a chrome visitor creates the cache, the page is different but as we can only have one cache file the FF user will get that cached page as well and vv.

Thing here is that CloudFlare modifies the page totally beyond our control by altering the final result.

Issue here is in the cloudflare script in combination with Chrome based browsers and should be fixed in their script: either fixing the root cause or by catching and handling these errors.

ocJSsocials is just the messenger here exposing the CloudFlare issue.

Please Log in to join the conversation.

More
6 months 4 weeks ago #2928 by Alex Baillie
Replied by Alex Baillie on topic ochJSsocials does not work in Chrome Based browsers
Hi Ruud,
It seems like what I'm trying to convey isn't coming across clearly. Essentially, what I'm suggesting is a function that determines whether the ochJSsocials script should be included in Rocket Loader or not. A simple on/off switch in the ochJSsocials plugin settings. This function would be browser-agnostic and unrelated to the current issue at hand. Its sole purpose would be to offer your customers the choice to exclude the ochJSsocials script from Rocket Loader. Consequently, the script would be included in the web page's HTML code as originally intended by you, ensuring its proper integration and functionality.
Thanks!
Alex

Please Log in to join the conversation.

More
6 months 4 weeks ago #2929 by Ruud van Lent
Replied by Ruud van Lent on topic ochJSsocials does not work in Chrome Based browsers
Hi Alex,
I'm always reluctant to build in workarounds for other products their (possible) issues.
It will become obsolete the moment they fix it and then the 'issue' / cost is on my side to maintain that workaround.

I have done some research on rocket loader and I see there are multiple JS issues where it states that it is not fully JavaScript compatible (also saw some recent with specific Chrome issues)

They advise to contact their support and raise an issue so they can investigate / test on your site (they can do that remote without you doing anything). Or they advise to just switch it off when not compatible.

Did you open a support ticket with them? If so what is the outcome?

Please Log in to join the conversation.