Skip to content

Commit

Permalink
Updated Facebook iframe v3
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshyPHP committed Aug 21, 2024
1 parent dc263b5 commit a22bb87
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions iframe/3/facebook.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,8 @@
url += (user || 'Bob') + '/posts/';
type = 'post';
}
url += id;

body.innerHTML = '<div data-href=' + url + ' class=fb-' + type + ' data-width=' + window.innerWidth + '>Loading Facebook SDK. You will need to disable any adblocker, privacy extension, or built-in tracking protection.</div>';
body.innerHTML = '<div data-href=' + url + id + ' class=fb-' + type + ' data-width=' + window.innerWidth + '>Loading Facebook SDK. You will need to disable any adblocker, privacy extension, or built-in tracking protection.</div>';

window.addEventListener(
'message',
Expand Down
2 changes: 1 addition & 1 deletion iframe/3/facebook.min.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><title>Content from Facebook</title><link rel=preconnect crossorigin href=//www.facebook.com><style>iframe{background:#fff;border-radius:3px;width:100vw !important}</style><body style=margin:0><script>((m,e,c)=>{let n=m.body,f,p=e.replace(/\W/g,''),g=(c.navigator||{}).language||'enUS',d,b='',h='//www.facebook.com/',q,k,l=[/^#([.\w]+)\/([prv])\w*\/(\w+)$/,/^#()([prv])(\d+)$/];for(const a of l)if(l=a.exec(e)){[e,q,b,p]=l;break}/[rv]/.test(b)?(h+='watch?v=',b='video'):(h+=(q||'Bob')+'/posts/',b='post');n.innerHTML='<div data-href='+(h+p)+' class=fb-'+b+' data-width='+c.innerWidth+'>Loading Facebook SDK. You will need to disable any adblocker, privacy extension, or built-in tracking protection.</div>';c.addEventListener('message',a=>{let r;if(r=/type=resize.*height=(\d+)/.exec(a.data))f=+r[1],k=+/width=(\d+)/.exec(a.data)[1]||0;else{if('s9e:init:3'!==a.data||d)return;d=a.ports[0]}d&&f&&(a={method:'resize',height:f},k&&(a.width=k),d.postMessage(a))},{capture:!0});c.onload=()=>{const a=m.createElement('script');a.src='//connect.facebook.net/'+g.substring(0,2)+'_'+g.toUpperCase().substring(g.length-2)+'/sdk.js#xfbml=1&version=v20.0';n.append(a)}})(document,location.hash,window)</script>
<!DOCTYPE html><title>Content from Facebook</title><link rel=preconnect crossorigin href=//www.facebook.com><style>iframe{background:#fff;border-radius:3px;width:100vw !important}</style><body style=margin:0><script>((m,e,c)=>{let n=m.body,f,p=e.replace(/\W/g,''),g=(c.navigator||{}).language||'enUS',d,b='',h='//www.facebook.com/',q,k,l=[/^#([.\w]+)\/([prv])\w*\/(\w+)$/,/^#()([prv])(\d+)$/];for(const a of l)if(l=a.exec(e)){[e,q,b,p]=l;break}/[rv]/.test(b)?(h+='watch?v=',b='video'):(h+=(q||'Bob')+'/posts/',b='post');n.innerHTML='<div data-href='+h+p+' class=fb-'+b+' data-width='+c.innerWidth+'>Loading Facebook SDK. You will need to disable any adblocker, privacy extension, or built-in tracking protection.</div>';c.addEventListener('message',a=>{let r;if(r=/type=resize.*height=(\d+)/.exec(a.data))f=+r[1],k=+/width=(\d+)/.exec(a.data)[1]||0;else{if('s9e:init:3'!==a.data||d)return;d=a.ports[0]}d&&f&&(a={method:'resize',height:f},k&&(a.width=k),d.postMessage(a))},{capture:!0});c.onload=()=>{const a=m.createElement('script');a.src='//connect.facebook.net/'+g.substring(0,2)+'_'+g.toUpperCase().substring(g.length-2)+'/sdk.js#xfbml=1&version=v20.0';n.append(a)}})(document,location.hash,window)</script>

0 comments on commit a22bb87

Please sign in to comment.