开发者

Github gist page won't load in iframe

开发者 https://www.devze.com 2023-04-10 20:04 出处:网络
I want to list all my gists on a single page and an iframe seemed like the quickest and easiest solution, the problem is that it won\'t load. My example show the same html used to make gist.github.com

I want to list all my gists on a single page and an iframe seemed like the quickest and easiest solution, the problem is that it won't load. My example show the same html used to make gist.github.com and google.com show in an iframe. Google will load but github won't.

Is this a limitation that Github imposes, is there a better way to list embed all my gists on a single page without adding each gist individually? 开发者_如何学JAVAI want it to show up automatically when I create a new one.

http://jsfiddle.net/guanome/VGEjB/1/


Github has added the X-Frame-Options: deny HTTP header, which prevents the page from being embedded in a page (such as a frame).

See also: https://developer.mozilla.org/en/The_X-FRAME-OPTIONS_response_header


Considering GitHub won't let you display its content with a frame, lime Rob mention in his answer (+1 btw), you could consider using the GitHub Api for Git.

That way, you build your own content.


Forgive me, because I am a big newbie - but I may have a solution.

Couldn't you download the webpage down to local and then add that to the server that you're hosting as a resource. Then, just add an href to the actual github.

Or alternatively,

possibly change the webpage to a pdf/png, using a webpage to pdf/png extension. Then use the of the pdf/png. I did this and it worked for me, unfortunately it's static and won't be up-to-date.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号