开发者

Workaround: site is www.example.com code incl. document.domain='example.com'

开发者 https://www.devze.com 2022-12-11 07:23 出处:网络
A customer site that I cannot change has the line document.domain = \"example.com\" while the site is at www.example.com.

A customer site that I cannot change has the line document.domain = "example.com" while the site is at www.example.com.

The effect is that FaceBook Connect window login gets stuck after submitting username+password.

Firebug shows its in infinite loop inside dispatchmessage fu开发者_如何学运维nction, which gives perpetual exception:

Error: Permission denied for <http://www.example.com> to get property Window.FB from <http://example.com>

Any idea how to work around this? I prefer not to ask the customer to remove the document.domain='example.com'


It seems like a really bad idea to tell the visitor's browser that the website is being served from a particular domain, when it in fact is not. The best solution would be to change that line. I take it you don't want to change it because they have some client-side code that depends on this?

One workaround would be to change the Facebook application's Connect URL to http://example.com, since Facebook's JavaScript will think that is where it is being executed.

0

精彩评论

暂无评论...
验证码 换一张
取 消