Popup.js文件:
window.fbAsyncInit = function() {
// init the FB JS SDK
FB.init({
appId : ******, // App ID from the app dashboard
status : true, // Check Facebook Login status
xfbml : false // Look for social plugins on the page
});
};
// Load the SDK asynchronously
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {
return;
}
js = d.createElement(s);
js.id = id;
js.src = "https://connect.facebook.net/en_US/all.js";
fjs.parentNode.insertBefore(js, fjs);
}
(document, 'script', 'facebook-jssdk'));
Run Code Online (Sandbox Code Playgroud)
清单文件:
{
"manifest_version": …Run Code Online (Sandbox Code Playgroud)