Facebook JavaScript API for google chrome extension -
i make chrome extension specific page posts automatically. simple popup controller , background thread handle fb api interactive
i cannot load facebook js api extension page official example method.
the script jssdk loaded , executed checked chrome developer tools.
but window.fb not defined script loaded!!!
- i add script tag manually.
- it appeared both background thread , popup window.
- if inject iframe load page, success loaded window.fb , popup login/authenticate window. had cross domain problem!
- the div#fb-root exist.
- menifest.json has content_security_policy
- script-src 'self' https://connect.facebook.net; object-src 'self'
i don't have solution, might lead in right direction.
the problem might document.location of extension document. javascript running in extension scope, protocol "chrome-extension://", while many js libraries expect either "http" or "https".
from looking @ following line @ jssdk file, seems fb make assumption well:
var k = typeof j == 'undefined' ? location.protocol.replace(':', '') : j ? 'https' : 'http';
try debugging these cases, replacing line above like:
var k = 'http';
hope helps.
Comments
Post a Comment