MCPcopy
hub / github.com/ampproject/amphtml / getFacebookSdk

Function getFacebookSdk

3p/facebook.js:31–39  ·  view source on GitHub ↗

* Produces the Facebook SDK object for the passed in callback. * * Note: Facebook SDK fails to render multiple plugins when the SDK is only * loaded in one frame. To Allow the SDK to render them correctly we load the * script per iframe. * * @param {!Window} global * @param {function(!Object)

(global, cb, locale)

Source from the content-addressed store, hash-verified

29 * @param {string} locale
30 */
31function getFacebookSdk(global, cb, locale) {
32 loadScript(
33 global,
34 'https://connect.facebook.net/' + locale + '/sdk.js',
35 () => {
36 cb(global.FB);
37 }
38 );
39}
40
41/**
42 * Create DOM element for all Facebook embeds.

Callers 1

facebookFunction · 0.85

Calls 2

loadScriptFunction · 0.90
cbFunction · 0.50

Tested by

no test coverage detected