XF 1.5 Disabling facebook's sdk.js for logged in users

thumped

Well-known member
In a situation where facebook registration and login is allowed, Facebook's sdk,js needs to be loaded so that unregistered / logged out users can register and log in using their facebook credentials. But is there any reason why the Facebook sdk.js call can't then be disabled once the user is logged in?

(I can only think of two reasons: the default xF social sharing buttons require it, but I'm using @wmtech Social Share Privacy instead so it doesn't need to be loaded. @xfrocks ' [BD] Social Share addon uses it too, for auto posting new threads to facebook - but I can use RSS feeds + IFTTT triggers to do that instead.)
 
I can't easily comment on what would happen as it depends on what the add-on does. I can see that the Facebook SDK initialization is being forced in the HTML source though, so it's being triggered by something on the server side.
 
sorry - i'm probably not being clear here so i'll rephrase it a bit & maybe explain where i'm coming from. So..

If i modify the code that invokes sdk.js from facebook's servers in page_container_js_body so that it only loads if a user is unregistered, will it break anything in unexpected and/or interesting ways? I'm talking about this bit
Code:
// Facebook Javascript SDK
XenForo.Facebook.appId = "{xen:jsescape $xenOptions.facebookAppId}";
XenForo.Facebook.forceInit = {xen:if $facebookSdk, true, false};

Basically i want to allow FB registrations & logins, but I don't want it loading for every logged in user on every page load, because of tinfoil hat privacy concerns and some miniscule efficiency gains. But mostly because it's just bugging me.
 
Basically i want to allow FB registrations & logins, but I don't want it loading for every logged in user on every page load
This is how it works by default. I was referring to the output from the XenForo.Facebook.forceInit on your site. It's showing as "true" on every page that I looked at. I was testing as a guest, but the default system only forces it with sharing blocks, rather than anything specific to guests. This makes me think it's an add-on that's involved.
 
This is how it works by default. I was referring to the output from the XenForo.Facebook.forceInit on your site. It's showing as "true" on every page that I looked at. I was testing as a guest, but the default system only forces it with sharing blocks, rather than anything specific to guests. This makes me think it's an add-on that's involved.
perfect, thanks
 
Top Bottom