Github gist page won't load in iframe

六月ゝ 毕业季﹏ 提交于 2019-11-30 04:13:15

问题


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? I want it to show up automatically when I create a new one.

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


回答1:


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.




回答2:


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




回答3:


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.



来源:https://stackoverflow.com/questions/7649361/github-gist-page-wont-load-in-iframe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!