It's a bit disappointing to see other people showcasing their own work without a single mention of the link above. Perhaps make your own submission instead if that's the intention?
As a casual reader and others obvious interest in this area I'd very much prefer a sentence or two about the quality of the work presented, feel free to link your own stuff afterwards, it's a bit offputting to see such blatant self-promotion.
Did you recognize how many people relate to their own experiences when you tell them a story while totally forgetting about the things you just said? You are totally right and if someone wants to present their project because it is similar they should at least say something about the differences etc. not just paste a URL to promote it.
I like when people link related projects. This is Why:
I have a use case for this project but I likely won’t get to it for a year or so. When that happens I’ll come back to this thread and all the projects working on the problem will be right here in the Hacker News thread. I’ll be able to see which ones are still alive, and maybe even see why some stopped development. This happens all the time for me with HN - if people didn’t link their related work the thread would have way less utility.
The value to me is the link to the other project. Otherwise it would be like trying to read a recipe online - obligatory filler text with the value buried at the bottom.
I’d take a self-promo related project comment over an unrelated complaint (hogging entire above-the-fold space) any day. Nothing is more frustrating than opening a discussion thread and the top comment with a million descendants bikesheds about something else entirely.
Also, you would occasionally see comments along the line of “awesome project / congratulations on launching, I like the fact that it does this and that. My project also does this and that, check it out: insert link.” Hardly any better.
I wish I worked in a domain like this. Most people who comment on my area of expertise are asking questions and those with projects are hello world level.
The projects that succeed to working prototype are one off itch scratches or API Jigsaw projects. Mine included, most of my code is API glue. But I never see HN as having utility in this way. But I'm in a small niche.
The problem with this stance is that it is very difficult to get a Show HN to the front page. You usually have about a half hour after submission to get four or five upvotes. (I watch /new and I've seen good projects submit over and over to try to get bites - with no luck.)
But also: self-promotion is a good thing. Or I should say: a better thing. If you can't promote your own project, then you are left to use advertising. This is why advertising is so hot right now. There aren't many avenues for self-promotion. Let people post their links and let's see where the chips fall.
At least take the effort of putting your project in context, which also adds some interest to the reader. Thin line between "good self-promotion" and "spam".
I don't know, I feel like one of the coolest things about HN is being in a community with others trying to do similar stuff. I definitely agree that it's not about just trying to hijack the top comment to get the runoff clicks, and I do see some comments here that are just links to other projects. Maybe my self-reference wasn't one that you were referring to, but I personally got a kick out of seeing another hobbyist doing something similar, and looking at their different approach to a similar problem.
When I've shared my own projects here this practice of a) people linking their own projects and b) people linking other projects/products that do similar thing was a bit disappointing.
What you really want is feedback on your own project
Congrats on getting your project to the front page of HN. With that said I think you are going to need to change your approach if you want this project to be usable as more than a toy project in the long run.
From what I can tell it essentially saves a map of url -> response in memory as you browse. Every 10 seconds this file is serialized to json and dumped to a cache.json file. This is going to be very inefficient as the number of web pages indexed grows since you are rewriting the entire cache every 10 seconds even if only a few pages have been added to it. It also will eventually exceed the memory of the computer running the app if the content of every page ever visited needs to be loaded into memory. I highly recommend looking into some of the other suggestions mentioned here, either sqlite or mapping a local directory structure to your caching strategy so that you can easily query a given url without keeping the entire cache in memory, and also add / update urls without rewriting the entire cache.
I wrote something similar years ago in Go, and settled on writing the data to a WARC file on disk (you can gzip the individual requests and concatenate to get random access), and also concatenating to a warc index file. The working index was kept in memory, while the warc index was read at startup.
My version acted as a proxy and would serve the latest entry from cache if a copy was cached. I had a special X-Skip-Cache header for when I wanted to go around the cache. (I can't remember if it handled https or if sites just didn't use https back then.) My use-case was web scraping, particularly recipe and blog sites. I wanted to be able to develop my scraping code without re-hitting the sites all the time. Structuring it as a proxy allowed me to just write my python scraping code as if I was talking to the server. Previously I'd written a layer on top of the python requests library to consult a cache stored in a directory (raw dumps of content / headers, with v2 involving git). But I found that required extra care when more than one script was running at once, and I liked the idea of storing it in a standardized format (WARC) that could be manipulated by other tools.
I tried to build something like this for jest tests in an app I worked on.
I wanted my jest tests to serve as both unit tests and service diagnostics - so I instrumented axios and setup a hidden cache layer within it when running inside the test suite. I was trying to figure out how to best organize the cache so I could run tests really quickly by having all results pulled from cache — or run it slow and as a service diagnostic mechanism by deleting the cache before execution ... I had to extend axios to accept a bit of additional logic from the application ... it was hard for me to get it to work properly inside of jest though ...
You could store the data in a git repo per domain, so that implicit de-duplication happens on re-visits & for shared resources.
You could have a raw dir (the files you receive from the server) and a render dir that consists of snapshots of the DOM + CSS with no JS & external resource complexity. When the global archive becomes too big, history could be discarded from all the git repos by discarding the oldest commit in each repo, and so on. SOLR is probably the right tool for the index but there is something undeniably appealing about staying in the pure file paradigm - you could use sqlite's FTS5 module to do that too.
You still end up with two copies of the same file, one in the local LFS “server”, one in the work tree, no? (I only played with LFS a bit many years ago when it first came out, so I could be wrong.) Unless you take into account deduplication built into certain filesystems.
Aside: are there non-binary and/or non-large blobs? I'm thinking along the lines of ATM machine / PIN number but maybe BLOB no longer implies "binary large" without being explicit.
I like this idea, especially using git to version the store. With automatic commits, you could roll back to a particular date to see the page versions then. A personal "archive.org" sounds very awesome!
I like the idea (not of git, but a personal archive), especially if search is integrated.
However what'd make it really amazing for me would be the ability to share those archived versions with everyone around the world, so we wouldn't have to duplicate our efforts or would have a higher chance of having that specific version of one special page saved. For now the best way to contribute to this seems to be centralization: Donate to archive.org.
what are the security implications of permanently running chrome in remote debug mode?
a bit more than half a year ago I started playing around with this and was surprised how on the one hand there are really really good tools nowadays for self archiving but how on the other hand there hasn't been any progress in implementing these in a, for end users, comfortable way My working theory right now is that saving every request/response as well as every interaction on a page should allow us to completely restore web site state at any point in time and will open up some super interesting use cases around our interaction with information found online But in order to do this it seems necessary to go through the remote debug protocol like this project here is doing. And since this is somewhat of an unusual approach I could not find much information about the security aspect of running every site at any time with remote debugging activated.
Common web scrapers/archiving tools will instead only use remote chrome debug to open and capture specific urls Storage is so dirt cheap today that there is zero reason why we shouldn't have reliable historic website state for everything we have ever looked at And judging by the HN front pages of the last months, many here are interested in this and related use cases (search/index/annotations/collaborative browsing)
> Storage is so dirt cheap today that there is zero reason why we shouldn't have reliable historic website state for everything we have ever looked at
I agree entirely, but I do about half my reading on mobile, and the phone company and the ad company have both decided that I shouldn’t be able to run extensions of any kind in the browsers available on my phone company phone or my ad company phone. I’m not really sure of the solution. I had planned to start a business around this, but without mobile support it is probably a nonstarter.
All of my contacts use iMessage; Signal is starting to be viable with their iPad release now though. I am concerned about switching from Chrome to Firefox still on security grounds, but this may be sufficient to make me switch.
> What are the security implications of running in remote debugging mode?
Great question. First up, as long as you don't put --remote-debugging-address=0.0.0.0 you are only exposed locally, so the debugging endpoint can only be accessed from your local machine. That leaves open the possibility that a web page can access that. There's two possibilities: - fetch('http://localhost:9222/json') which errors or is opaque because it is non CORS, or - connecting directly to the websockets for targets, which have addresses like, http://localhost:9222/devtools/page/<128_bit_hex_string> Interestingly, you can connect to the websocket, you just need to know the random identifier. There are probably some DevTools zero days, but apart from those it looks like it's OK unless: 0) the identifier is not random, 1) you can get past CORS on the localhost which might be possible with an exploited extension, 3rd party software or plugin or 2) you can guess the websocket 128-bit identifier. (Guessing should only take 500 billion years. Even so 128 bits seems quite short relative to some encryption keys but there's probably a reason for that.) Regarding 0) checking the Chromium source it appears that these ids are passed in to the constructor of "DevToolsAgentHostImpl": https://cs.chromium.org/chromium/src/content/browser/devtool... and are either "GUID"s or "tokens" and in the former case they are created here: https://cs.chromium.org/chromium/src/base/guid.cc?sq=package... and in the latter case by a class revealingly named "unguessabletoken.h": https://cs.chromium.org/chromium/src/base/unguessable_token.... which in each case appears to rely on getting random bytes from a file descriptor to "urandom" which I think is an operating system level randomness primitive.
Is it possible to send a no-cors POST that causes side effects (regardless of the opaque response)? I have only used the DevTools protocol through puppeteer, so don’t know anything about its authentication. Could it be vulnerable?
Comments (97) 24 threads
As a casual reader and others obvious interest in this area I'd very much prefer a sentence or two about the quality of the work presented, feel free to link your own stuff afterwards, it's a bit offputting to see such blatant self-promotion.
Did you recognize how many people relate to their own experiences when you tell them a story while totally forgetting about the things you just said?
You are totally right and if someone wants to present their project because it is similar they should at least say something about the differences etc. not just paste a URL to promote it.
I have a use case for this project but I likely won’t get to it for a year or so. When that happens I’ll come back to this thread and all the projects working on the problem will be right here in the Hacker News thread. I’ll be able to see which ones are still alive, and maybe even see why some stopped development.
This happens all the time for me with HN - if people didn’t link their related work the thread would have way less utility.
Looking at the projects presented here with nothing else offered am not convinced of good-faith participation. Would you say the same?
Also, you would occasionally see comments along the line of “awesome project / congratulations on launching, I like the fact that it does this and that. My project also does this and that, check it out: insert link.” Hardly any better.
The projects that succeed to working prototype are one off itch scratches or API Jigsaw projects. Mine included, most of my code is API glue. But I never see HN as having utility in this way. But I'm in a small niche.
But also: self-promotion is a good thing. Or I should say: a better thing. If you can't promote your own project, then you are left to use advertising. This is why advertising is so hot right now. There aren't many avenues for self-promotion.
Let people post their links and let's see where the chips fall.
What you really want is feedback on your own project
From what I can tell it essentially saves a map of url -> response in memory as you browse. Every 10 seconds this file is serialized to json and dumped to a cache.json file. This is going to be very inefficient as the number of web pages indexed grows since you are rewriting the entire cache every 10 seconds even if only a few pages have been added to it. It also will eventually exceed the memory of the computer running the app if the content of every page ever visited needs to be loaded into memory. I highly recommend looking into some of the other suggestions mentioned here, either sqlite or mapping a local directory structure to your caching strategy so that you can easily query a given url without keeping the entire cache in memory, and also add / update urls without rewriting the entire cache.
https://github.com/dosyago/22120#future
My version acted as a proxy and would serve the latest entry from cache if a copy was cached. I had a special X-Skip-Cache header for when I wanted to go around the cache. (I can't remember if it handled https or if sites just didn't use https back then.)
My use-case was web scraping, particularly recipe and blog sites. I wanted to be able to develop my scraping code without re-hitting the sites all the time. Structuring it as a proxy allowed me to just write my python scraping code as if I was talking to the server.
Previously I'd written a layer on top of the python requests library to consult a cache stored in a directory (raw dumps of content / headers, with v2 involving git). But I found that required extra care when more than one script was running at once, and I liked the idea of storing it in a standardized format (WARC) that could be manipulated by other tools.
I wanted my jest tests to serve as both unit tests and service diagnostics - so I instrumented axios and setup a hidden cache layer within it when running inside the test suite. I was trying to figure out how to best organize the cache so I could run tests really quickly by having all results pulled from cache — or run it slow and as a service diagnostic mechanism by deleting the cache before execution ... I had to extend axios to accept a bit of additional logic from the application ...
it was hard for me to get it to work properly inside of jest though ...
You could have a raw dir (the files you receive from the server) and a render dir that consists of snapshots of the DOM + CSS with no JS & external resource complexity.
When the global archive becomes too big, history could be discarded from all the git repos by discarding the oldest commit in each repo, and so on.
SOLR is probably the right tool for the index but there is something undeniably appealing about staying in the pure file paradigm - you could use sqlite's FTS5 module to do that too.
You still end up with two copies of the same file, one in the local LFS “server”, one in the work tree, no? (I only played with LFS a bit many years ago when it first came out, so I could be wrong.) Unless you take into account deduplication built into certain filesystems.
Continue this thread — 4 replies
However what'd make it really amazing for me would be the ability to share those archived versions with everyone around the world, so we wouldn't have to duplicate our efforts or would have a higher chance of having that specific version of one special page saved.
For now the best way to contribute to this seems to be centralization: Donate to archive.org.
a bit more than half a year ago I started playing around with this and was surprised how on the one hand there are really really good tools nowadays for self archiving but how on the other hand there hasn't been any progress in implementing these in a, for end users, comfortable way
My working theory right now is that saving every request/response as well as every interaction on a page should allow us to completely restore web site state at any point in time and will open up some super interesting use cases around our interaction with information found online
But in order to do this it seems necessary to go through the remote debug protocol like this project here is doing. And since this is somewhat of an unusual approach I could not find much information about the security aspect of running every site at any time with remote debugging activated. Common web scrapers/archiving tools will instead only use remote chrome debug to open and capture specific urls
Storage is so dirt cheap today that there is zero reason why we shouldn't have reliable historic website state for everything we have ever looked at
And judging by the HN front pages of the last months, many here are interested in this and related use cases (search/index/annotations/collaborative browsing)
I agree entirely, but I do about half my reading on mobile, and the phone company and the ad company have both decided that I shouldn’t be able to run extensions of any kind in the browsers available on my phone company phone or my ad company phone.
I’m not really sure of the solution. I had planned to start a business around this, but without mobile support it is probably a nonstarter.
[1] https://github.com/gildas-lormeau/SingleFile
Continue this thread — 3 replies
Great question. First up, as long as you don't put --remote-debugging-address=0.0.0.0 you are only exposed locally, so the debugging endpoint can only be accessed from your local machine.
That leaves open the possibility that a web page can access that.
There's two possibilities:
- fetch('http://localhost:9222/json') which errors or is opaque because it is non CORS, or
- connecting directly to the websockets for targets, which have addresses like, http://localhost:9222/devtools/page/<128_bit_hex_string>
Interestingly, you can connect to the websocket, you just need to know the random identifier.
There are probably some DevTools zero days, but apart from those it looks like it's OK unless:
0) the identifier is not random,
1) you can get past CORS on the localhost which might be possible with an exploited extension, 3rd party software or plugin or
2) you can guess the websocket 128-bit identifier. (Guessing should only take 500 billion years. Even so 128 bits seems quite short relative to some encryption keys but there's probably a reason for that.)
Regarding 0) checking the Chromium source it appears that these ids are passed in to the constructor of "DevToolsAgentHostImpl":
https://cs.chromium.org/chromium/src/content/browser/devtool...
and are either "GUID"s or "tokens" and in the former case they are created here:
https://cs.chromium.org/chromium/src/base/guid.cc?sq=package...
and in the latter case by a class revealingly named "unguessabletoken.h":
https://cs.chromium.org/chromium/src/base/unguessable_token....
which in each case appears to rely on getting random bytes from a file descriptor to "urandom" which I think is an operating system level randomness primitive.
Continue this thread — 1 reply
https://cs.chromium.org/chromium/src/content/browser/devtool...
which looks like it ignores the HTTP verb and acts only on the path. I confirmed this with tests: fetch('http://localhost:9222/json/new') and fetch('http://localhost:9222/json/new, {method:'POST', body:''}) do the same thing, as does using verb 'DELETE'.
All these open a new tab. Without knowing a 128-bit target identifier, it looks like opening a new tab is the only thing you can do if someone is running DevTools.
What about DNS rebinding attacks?
https://bugs.chromium.org/p/chromium/issues/detail?id=813540
All comments shown.
Couldn't load more comments. Check your connection and try again.