检查Facebook页面(在iframe网站插件中使用)是否为“隐私限制”页面

时间:2019-02-08 20:26:31

标签: javascript html facebook facebook-javascript-sdk

某些Facebook页面的插件无法嵌入。某些原因似乎是令人反感的内容,另一个原因是受隐私限制的页面。 (这是一个类似的问题 Facebook Page Plugin is not working - only for one site

一个插件是站点插件:https://developers.facebook.com/docs/plugins/page-plugin#privacy

如何检查页面是否限制为不显示空白iframe?

这是我要用图像或段落替换(jquery)的示例iframe,因为加载的iframe为空,因为页面受到限制。

	(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/de_DE/sdk.js#xfbml=1&version=v3.2';
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
  
  $(document).ready(function(){
  var bh = 0;
$(".holder").css('width', $("#ReinekeFuchsCologneEVENTS").css("width"));
$(".bar").css('width', $("#ReinekeFuchsCologneEVENTS").css("width")); 
bh = $("#ReinekeFuchsCologne").css('height');$(".bar").css('height', bh); $("#ReinekeFuchsCologneEVENTS").hide(); $("#ReinekeFuchsCologneCLICK").css('width', $("#ReinekeFuchsCologneEVENTS").css("width")); $("#ReinekeFuchsCologneCLICK").click(function s(){ $("#ReinekeFuchsCologne").toggle();  										$("#ReinekeFuchsCologneEVENTS").toggle();
  										$("#ReinekeFuchsCologneCLICK").css('height', bh);
			  });     
         });   
.bar{
    position:absolute;
    top:0;
 #  left:0;
    width:100%;
   height:100%;
		opacity: 0.2;}
.bar:hover{
    background: red;
		}
.bar:after {
    content: "Here should be appear the content of iframe of the Facebook Page or an alternativ error splash screen";
    }
.holder{
vertical-align: top; 
    white-space: normal; 
     float: left;
    position:relative;
}
.frame{
    width: 100%;
    height:100%;
    background :blue;
}
.container{
 display: inline-block;		}
	  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  <div id="fb-root"></div>
  
  <div class="holder">
	<iframe id="ReinekeFuchsCologneEVENTS" src="https://www.facebook.com/plugins/page.php?href=https%3A%2F%2Fwww.facebook.com%2Fpg%2FReinekeFuchsCologne&tabs=events&width=500&height=499&small_header=true&adapt_container_width=true&hide_cover=false&show_facepile=false&appId" width="500" height="499" style="border:none;overflow:hidden;" scrolling="no" frameborder="0" allowTransparency="true" allow="encrypted-media"></iframe>
 
 	<div id="ReinekeFuchsCologneCLICK" class="bar"></div>
	<iframe id="ReinekeFuchsCologne" src="https://www.facebook.com/plugins/page.php?href=https%3A%2F%2Fwww.facebook.com%2FReinekeFuchsCologne%2F&tabs&width=500&height=70&small_header=true&adapt_container_width=true&hide_cover=false&show_facepile=false&appId" width="500" height="70" style="border:none;overflow:hidden;" scrolling="no" frameborder="0" allowTransparency="true" allow="encrypted-media"></iframe>
 
</div><!--end of Holder-->

0 个答案:

没有答案