Embed slack on a html page

10,388

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.

Share:
10,388
kir13y
Author by

kir13y

Updated on June 19, 2022

Comments

  • kir13y
    kir13y almost 2 years

    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

  • kir13y
    kir13y over 8 years
    Thanks for the response but it doesn't seem to work when changing the url to our slack url. (the jsfiddle) the iframe is just a white box >_< If you know why this is happening then please do tell me.
  • Whirlwind990
    Whirlwind990 over 8 years
    could be an issue with the data being retrieved from the server and not the code. Does the debug console say anything?
  • kir13y
    kir13y over 8 years
    Failed to load resource: net::ERR_INSECURE_RESPONSE using https instead of http is still giving the same error
  • Alex Cio
    Alex Cio about 7 years
    You could do so many interesting things with slack if you could integrate it into your own webpage. Really waiting for this feature!
  • MLK.DEV
    MLK.DEV almost 7 years
    You could ajax a script on your own domain that retrieves the markup for you. iframe.html > proxy.php > slack.com/stuff
  • Ivan Peevski
    Ivan Peevski almost 7 years
    As per above comments, even if the syntax was correct, it still won't work due to X-Frame-Options security restrictions