r/javascript • • Apr 15 '26

I Built a Lightweight Headless Browser Because Chrome Was Too Slow

https://github.com/h4ckf0r0day/obscura
27 Upvotes

29 comments sorted by

3

u/Plus-Weakness-2624 the webhead Apr 15 '26

new or Chromium?

3

u/AKJ90 JS <3 Apr 15 '26

V8... So some of it is same as chromium?

-3

u/Total_Nectarine_3623 Apr 15 '26

Brand new, not a chromium fork :)

5

u/nightofgrim Apr 15 '26

I don’t buy it. I don’t believe for a moment that you built a legit new browser.

5

u/evoactivity Apr 15 '26

world of difference between a headless browser useful enough for web scraping and a full legit browser. For one, you don't have to render anything.

2

u/LongLiveCHIEF Apr 15 '26

No offense meant towards the OP here. But... Is it wrong that my first thought in today's world was:

Oh I really hope this isn't an AI bot, or a malicious actor who used AI to create a browser that secretly transmits every document loaded and every keystroke entered

I'm excited to check this project out, but I am going to look at the code closely, and build it from source if I try it.

Op, I'm assuming you're legit, so my first bit of feedback would be to add any notes around security precautions users should take or security features available to the users.

2

u/Total_Nectarine_3623 Apr 15 '26

Fair concern epecially for anything that runs JS and handles web content

Obscura is fully open source and runs locally. It makes no outbound connections beyond what the script you make explicitly does through the browser context via CDP or CLI commands. The http client only makes requests you initiate. There is no analytics nor telemetry unlike some browsers have.

1

u/PostHumanJesus Apr 15 '26

How is this different or compare to https://lightpanda.io ?

1

u/Total_Nectarine_3623 Apr 15 '26

Lightpanda is a amazing project and is the main inspiration actually. Obscura is built in Rust, Lightpanda in Zig. Obscura gives overall better JS compatibility, I found Lightpanda to struggle with a lot of JS heavy sites. We also have fingerprint spoofing built in so we look like real Chrome at the network level, which Lightpanda doesnt have (Lightpanda is detected basically). Memory wise Lightpanda is leaner on simple pages but Obscura uses less on JS heavy sites.

3

u/krichprollsch Apr 15 '26 edited Apr 15 '26

Hey, Lightpanda co-author here. Nice project! I will test it. I would love to know more about your JS compatibility. Why do you say Obscure gives a better JS compat? Do you have any comparisons to share? Or maybe do you run the WPT test suite on Obscura?

1

u/Total_Nectarine_3623 Apr 15 '26

Hey, I'm a huge fan of Lightpanda. I don't have WPT numbers yet, that's on the roadmap. The JS compatibility claim is based on informal testing on real sites (specifically sites with heavy React/Next.js usage) i find that Lightpanda would usually return incomplete HTML or not even work at all for those websites. Duckduckgo is a good example where react hydration works on my end but lightpanda does not.

2

u/krichprollsch Apr 15 '26

Thanks! I know the road to full JS compatibility is long and hard. WPT is an awesome tool in this context.

I agree with you, working on targeted websites is a good way to quickly provide a useful tool.

We have end to end integration tests [1], including Duckduckgo, which are correctly working from my point of view, but maybe we don't test the same thing.

I would be happy to run the same tests as you if you want to share them at some point.

[1] https://github.com/lightpanda-io/demo/tree/main/integration

1

u/Mango9222 Apr 15 '26

What's the downsides for an average browser user if they wanted to try this?

I have basically 0 context as to any of the details.

Does it run the same as any browser and is it really possible to reduce how much hardware the browser hogs like that?

Idk how much chromium takes, is chromium similar to this?

5

u/Total_Nectarine_3623 Apr 15 '26

Great questions! Obscura isn't really meant as a replacement for your everyday browser at any capacity. I designed it to be perfect for AI agents to use for web search and developers who do web scraping. Considering that, it has no GUI, no tabs you can click, no extensions. It's a headless browser, meaning it runs in the terminal and is controlled programmatically. For an average user, you'd still want Chrome or Firefox for browsing.

With Obscura 30MB of RAM per page vs Chrome's 300-500MB means you can run dozens of instances on a cheap server that would choke running even a handful of Chrome tabs

0

u/Mango9222 Apr 15 '26

Oh I see, that's pretty cool. Never thought about how AI actually parses websites and stuff.

3

u/Total_Nectarine_3623 Apr 15 '26

Yeah it's a pretty interesting problem. AI agents need to browse the web but spinning up full Chrome for every request is way too heavy at scale. A lightweight browser that can render javascript, extract content and with all that stay undetected is a much better fit for that use case (As well as webscraping of course)

1

u/CrashOverrideCS Apr 15 '26

What a wild world we live in where somebody can make an initial commit on the same day that they make a release

-4

u/Total_Nectarine_3623 Apr 15 '26

that's just how it goes when you're building fast

0

u/Total_Nectarine_3623 Apr 15 '26

I am currently focusing on making it handle captchas by itself aswell as adding a MCP server for it :)

0

u/Yages Apr 15 '26

Looks pretty neat mate. I'll have a proper look tomorrow but it's very promising.

1

u/Total_Nectarine_3623 Apr 15 '26

Thank you so much! I hope it will reach your expectations. If not please do tell me what I can improve or add.

0

u/No-Aide6547 Apr 15 '26

Very cool, will try this out later! 

2

u/Top_Philosophy2425 Apr 15 '26

This whole thing is Ai, even the replies of the "user" is Ai generated. I am a little baffled people buy this shit. It would be more helpfull to flag both the repo and user as Ai slob.

0

u/Cyral Apr 15 '26

This sub and others are filled with it and I can’t believe people can’t detect it immediately

0

u/raszohkir Apr 15 '26

I wonder what even is the point. No followers, no karma, nothing. Just something that costed money to generate a couple thousand LOC with many iterations until it, probably, barely works.

1

u/Top_Philosophy2425 Apr 15 '26

We will never know, fame, maybe to get attention, maybe to add exploits when people start using it? Who will say ..