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

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

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -