Live data from Hacker News

Githtml - View Html Files from Github Repos On The Fly

github.com

1–10 of 22 posts

Re: Githtml - View Html Files from Github Repos On The Fly

#5
This has a really big security flaw, if the creator wanted to be mischievous he could change his js file to do things to your logged in github account, for example set your privet repositories public.

If you want to use it you should fork it and change to bookmarklet to use your fork of the js file.

Re: Githtml - View Html Files from Github Repos On The Fly

#7
post #6

This seems like a lot of code... Here's what I use: javascript:void(document.body.innerHTML = document.getElementsByTagName("pre")[0].innerHTML.replace(/&/g,"&").replace(/</g," ").replace(/ /g," ")); (Note: I've only tested this on Chrome.)

Most of the code is for mapping css and js files to the relative raw pages.

Try your code on this page: https://raw.github.com/mrdoob/three.js/46c0a8434d3f269741a88...

And compare it with githtml on the /blob/ version of the same page: https://github.com/mrdoob/three.js/blob/master/examples/canv...

Re: Githtml - View Html Files from Github Repos On The Fly

#9

This has a really big security flaw, if the creator wanted to be mischievous he could change his js file to do things to your logged in github account, for example set your privet repositories public. If you want to use it you should fork it and change to bookmarklet to use your fork of the js file.

Though I'd never do such a thing, your point is completely valid.

Re: Githtml - View Html Files from Github Repos On The Fly

#10
post #7
post #6

This seems like a lot of code... Here's what I use: javascript:void(document.body.innerHTML = document.getElementsByTagName("pre")[0].innerHTML.replace(/&/g,"&").replace(/</g," ").replace(/ /g," ")); (Note: I've only tested this on Chrome.)

Most of the code is for mapping css and js files to the relative raw pages. Try your code on this page: https://raw.github.com/mrdoob/three.js/46c0a8434d3f269741a88... And compare it with githtml on the /blob/ version of the same page: https://github.com/mrdoob/three.js/blob/master/examples/canv...

CSS works fine. (Try this one: https://raw.github.com/twitter/bootstrap/master/docs/index.h...)

I suspect that JS that didn't depend on the page-load to trigger it would work too. I had never considered looking at JS-enabled pages though. When I wrote my bookmarklet, I just needed to view static documentation.

Edit: I found a page with only on-click JS events, and they didn't work. Oh well...

Post reply on HN