Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Embed slack on a html page

I am having trouble embedding a slack feed onto a html site. When I try to use an iframe, it just shows up as a white box. I have tried using jquery

<!DOCTYPE html>
<html>
  <head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"> .       
    </script>
    <script>
$("#testLoad").load("http://www.SlackURLHere");
    </script>
  </head>
  <body>

    <div id="testLoad"></div>

    <iframe src="http://www.SlackURLHere"></iframe>
  </body>
</html>

I have tried with "http" and "https" on both iframe and jquery with no luck. :( So if you have any other methods please do share!

Thanks

like image 885
kir13y Avatar asked Aug 17 '15 01:08

kir13y


1 Answers

Just tried this and it looks like the reason it won't display is because of the X-Frame-Options header which is set by slack.com to be SAMEORIGIN. In other words, you're only allowed to embed that page when on slack.com, not anywhere else.

like image 126
Jimmy Song Avatar answered Nov 02 '22 08:11

Jimmy Song