Skip to content

Commit

Permalink
Updated Reddit iframe
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshyPHP committed Apr 25, 2024
1 parent 109c0b6 commit b798ea2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions iframe/2/reddit.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
let m = /resize.embed","data":(\d+)/.exec(e.data);
if (m)
{
document.querySelector('b')?.remove();
height = +m[1];
}
else if (e.data === 's9e:init')
Expand Down
2 changes: 1 addition & 1 deletion iframe/2/reddit.min.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><title>Content from Reddit</title><style>body{margin:0}iframe{background:url(//www.redditstatic.com/circled-snoo-1x.png) top 96px right 64px / 26px no-repeat;border:0;border-radius:8px;height:100vh;width:100%}b{color:#ff4500;font-family:sans-serif;font-size:27px;position:absolute;right:16px;top:22px}</style><script>((e,f)=>{let g,k=/#((?:depth|show\w+|theme)=\w+)/g,a,b,c='<b>reddit</b><iframe allowfullscreen loading=eager scrolling=no src="//www.redditmedia.com/r/'+e.replace(/#.*/,'').replace(/[^\w/]/g,'')+'?embed=true&depth=1';for(;g=k.exec(e);)c+='&'+g[1];c+='"></iframe>';f.onload=()=>{document.body.innerHTML=c};f.onmessage=d=>{let h=/resize.embed","data":(\d+)/.exec(d.data);h?a=+h[1]:'s9e:init'===d.data&&(b=d.ports[0]);a&&b&&b.postMessage(a)}})(location.hash.substring(1),window)</script>
<!DOCTYPE html><title>Content from Reddit</title><style>body{margin:0}iframe{background:url(//www.redditstatic.com/circled-snoo-1x.png) top 96px right 64px / 26px no-repeat;border:0;border-radius:8px;height:100vh;width:100%}b{color:#ff4500;font-family:sans-serif;font-size:27px;position:absolute;right:16px;top:22px}</style><script>((e,f)=>{let g,k=/#((?:depth|show\w+|theme)=\w+)/g,a,b,c='<b>reddit</b><iframe allowfullscreen loading=eager scrolling=no src="//www.redditmedia.com/r/'+e.replace(/#.*/,'').replace(/[^\w/]/g,'')+'?embed=true&depth=1';for(;g=k.exec(e);)c+='&'+g[1];c+='"></iframe>';f.onload=()=>{document.body.innerHTML=c};f.onmessage=d=>{let h=/resize.embed","data":(\d+)/.exec(d.data);h?(document.querySelector('b')?.remove(),a=+h[1]):'s9e:init'===d.data&&(b=d.ports[0]);a&&b&&b.postMessage(a)}})(location.hash.substring(1),window)</script>

0 comments on commit b798ea2

Please sign in to comment.