frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Show HN: Greppers – fast CLI cheat sheet with instant copy and shareable search

https://www.greppers.com/
23•shellsteady•1h ago•7 comments

Oldest recorded transaction

https://avi.im/blag/2025/oldest-txn/
103•avinassh•5h ago•47 comments

Qwen3 30B A3B Hits 13 token/s on 4xRaspberry Pi 5

https://github.com/b4rtaz/distributed-llama/discussions/255
235•b4rtazz•9h ago•85 comments

We hacked Burger King: How auth bypass led to drive-thru audio surveillance

https://bobdahacker.com/blog/rbi-hacked-drive-thrus/
205•BobDaHacker•7h ago•115 comments

The maths you need to start understanding LLMs

https://www.gilesthomas.com/2025/09/maths-for-llms
389•gpjt•3d ago•91 comments

Using Claude Code SDK to reduce E2E test time

https://jampauchoa.substack.com/p/best-of-both-worlds-using-claude
62•jampa•2h ago•46 comments

Anthropic agrees to pay $1.5B to settle lawsuit with book authors

https://www.nytimes.com/2025/09/05/technology/anthropic-settlement-copyright-ai.html?unlocked_art...
871•acomjean•1d ago•662 comments

Processing Piano Tutorial Videos in the Browser

https://www.heyraviteja.com/post/portfolio/piano-reader/
6•catchmeifyoucan•2d ago•1 comments

The World War Two bomber that cost more than the atomic bomb

https://www.bbc.com/future/article/20250829-the-bomber-that-became-ww2s-most-expensive-weapon
49•pseudolus•3d ago•28 comments

AI surveillance should be banned while there is still time

https://gabrielweinberg.com/p/ai-surveillance-should-be-banned
374•mustaphah•6h ago•126 comments

Why language models hallucinate

https://openai.com/index/why-language-models-hallucinate/
80•simianwords•12h ago•89 comments

Europe enters the exascale supercomputing league with Jupiter

https://ec.europa.eu/commission/presscorner/detail/en/ip_25_2029
14•Sami_Lehtinen•21m ago•0 comments

The life-changing Sarah Paine framework

https://www.valstech.blog/p/the-life-changing-sarah-paine-framework
20•ashia•2d ago•3 comments

Baby's first type checker

https://austinhenley.com/blog/babytypechecker.html
40•alexmolas•3d ago•8 comments

Normalization of deviance (2015)

https://danluu.com/wat/
28•tyleo•1h ago•5 comments

Rug pulls, forks, and open-source feudalism

https://lwn.net/SubscriberLink/1036465/e80ebbc4cee39bfb/
221•pabs3•14h ago•94 comments

Our love letter to Internet Relay Chat [video]

https://www.youtube.com/watch?v=6UbKenFipjo
75•zdw•4d ago•39 comments

GigaByte CXL memory expansion card with up to 512GB DRAM

https://www.gigabyte.com/PC-Accessory/AI-TOP-CXL-R5X4
4•tanelpoder•2h ago•2 comments

Speeding up Unreal Editor launch by not spawning unused tooltips

https://larstofus.com/2025/09/02/speeding-up-the-unreal-editor-launch-by-not-spawning-38000-toolt...
189•samspenc•3d ago•77 comments

AI hype is crashing into reality. Stay calm

https://www.businessinsider.com/ai-hype-crashing-into-reality-iphone-openai-2025-9
12•01-_-•1h ago•2 comments

Kenvue stock drops on report RFK Jr will link autism to Tylenol during pregnancy

https://www.cnbc.com/2025/09/05/rfk-tylenol-autism-kenvue-stock-for-url.html
72•randycupertino•22h ago•210 comments

Video Game Blurs (and how the best one works)

https://blog.frost.kiwi/dual-kawase/
245•todsacerdoti•3d ago•37 comments

996

https://lucumr.pocoo.org/2025/9/4/996/
846•genericlemon24•6h ago•403 comments

A Software Development Methodology for Disciplined LLM Collaboration

https://github.com/Varietyz/Disciplined-AI-Software-Development
75•jay-baleine•9h ago•29 comments

The repercussions of missing an Ampersand in C++ and Rust

https://www.nablag.com/rust_cpp_missing_ampersand
61•nablags•4d ago•56 comments

Purposeful animations

https://emilkowal.ski/ui/you-dont-need-animations
499•jakelazaroff•1d ago•126 comments

The Universe Within 12.5 Light Years

http://www.atlasoftheuniverse.com/12lys.html
245•algorithmista•21h ago•165 comments

Novel hollow-core optical fiber transmits data faster with record low loss

https://phys.org/news/2025-09-hollow-core-optical-fiber-transmits.html
123•Wingy•2d ago•57 comments

Patterns, Predictions, and Actions – A story about machine learning

https://mlstory.org/
6•vinhnx•3h ago•0 comments

GLM 4.5 with Claude Code

https://docs.z.ai/guides/llm/glm-4.5
175•vincirufus•19h ago•77 comments
Open in hackernews

Say Bye with JavaScript Beacon

https://hemath.dev/blog/say-bye-with-javascript-beacon/
75•moebrowne•5d ago

Comments

tux3•2d ago
If you'd like, you can also Say Bye to Say Bye with JavaScript Beacons in about:config by setting beacon.enabled to false
bilekas•2d ago
This would be nice but I can't see any option for Chromium/Brave inside the chrome://flags .. Do you know if there is one ?
ravenstine•2d ago
This mostly works, but I have come across a minority of sites that break because of this. Whether that's a good thing or not is up to interpretation (I keep it disabled).
bilekas•2d ago
So this is kind of interesting, and I had a look at the spec.

> The data parameter is the BodyInit data that is to be transmitted.

However I couldn't find any information in the Spec itself about the size of the data until it said this :

> The user agent imposes limits on the amount of data that can be sent via this API: [...] If the amount of data to be queued exceeds the user agent limit [...] , this method returns false; a return value of true implies the browser has queued the data for transfer. However, since the actual data transfer happens asynchronously, this method does not provide any information whether the data transfer has succeeded or not.

Am I missing something or does this seem as unreliable as any other method for achieving this ?

How about, and this might be a crazy idea, letting the users leave without annoying them ?

lifthrasiir•2d ago
Technically speaking a conforming agent can ignore every single sendBeacon call by always returning false. And that's a point: beacons are opportunistic asynchronous requests. You can't do anything when they error anyway, so they should be regarded as hints that agents may or may not honor.
bilekas•2d ago
Okay so it's basically just a baked in implementation of what people did already but instead of using onUnload they have more visibility into the client context. Seems dirty in a way, the agent could basically internally call the same thing and send any data to their own server on every page?

For example, firefox, If they wanted, could record all your browsing history without notifying you? For any bad actor this seems like an amazing attack point.

swiftcoder•2d ago
Firefox could do that anyway, whether or not this API exists. Browser implementors need to be at least moderately trustworthy, or no one will use them.
andrewstuart•2d ago
Where has this been hiding how did I not know about this?
tuzemec•2d ago
Major hm... analytic tools... like MixPanel support this.
Zealotux•2d ago
You may not want to rely too much on `beforeunload` events though as it is unreliable on mobile, a good practice if you want to send analytics if to listen to the page visibility:

  document.addEventListener('visibilitychange', () => {
    if (document.visibilityState === 'hidden') {
      navigator.sendBeacon(...);
    }
  });
Of course it can't strictly be considered a "page leave" but for mobile users it's often your best bet: https://developer.chrome.com/docs/web-platform/page-lifecycl...
meindnoch•2d ago
>Sometimes we want to send a piece of data to our servers when user leaves our website or webapp.

I've never.

>Maybe it’s for for analytics or even auto-logout when they leave the website.

Just don't persist the auth token? Analytics is blocked at the DNS level anyway.

can16358p•2d ago
There might be some sensitive applications where server might want to immediately revoke credentials server-side though.
meindnoch•2d ago
And what will this hyper-sensitive application do if I yank the power cable from the computer? Or if I quit the browser with kill -9?

See, this is one of those "features" that clueless PMs ask their developers to implement, not having the technical knowledge to realize that their idea is unsalvageable. My other favorite is email address "validation" with ad hoc string format checks.

can16358p•1d ago
It's just an extra measure, not protecting the server from a malicious user, but an honest user's potential mismanagement of credentials.
DanielHB•2d ago
This is neat, but don't service-workers persist for like 5s (non-deterministic) before being unloaded?
Arch-TK•2d ago
Surely if you want to reliably do some action when a user leaves your page then some persistent connection which dies is by far the most reliable option...?

I'm no frontend expert but cant you just open a websocket and when the websocket dies from the server's perspective, you have your cue to do whatever cleanup you wanted to do?

I also agree with the others here that there shouldn't really be a _need_ for this kind of feature.

bilekas•2d ago
> I'm no frontend expert but cant you just open a websocket and when the websocket dies from the server's perspective, you have your cue to do whatever cleanup you wanted to do?

If I'm not mistaken, and I very well might be, it's kind of the same, however a WS connection here may be less reliable, infact if the user has a spotty connection, when you think "That user left", in the case of a local cleanup, okay that could run on the client side, however this beacon seems to be aimed at sending data back to the server when you leave, in the case of a dropped connection, you wont be able to send the data back anyway to the server.

For this 'browser' based implementation under the hood, the browser *should* have more insight into the real intention of the users exit.

Arch-TK•1d ago
I really wouldn't want to be doing anything that requires reliability on the back of either solution as user agents can just opt to never send beacons.
Etheryte•2d ago
Keeping a websocket alive would work, but then you're stuck holding a websocket for all of your users for the full session. Fine if you need a socket anyway, pretty wasteful if you don't. Sockets are pretty cheap these days, but I wouldn't really give this serious thought for a page with a lot of users.
Arch-TK•1d ago
Holding a socket is very cheap. Unless websockets introduce some overhead I am not aware of.
afavour•2d ago
You're right that a persistent connection is the most reliable option. But it's also significantly more difficult to scale and will cause battery drain on mobile devices. The Beacon API is a better alternative for not-entirely-essential cases like analytics.
Arch-TK•1d ago
[delayed]
azangru•2d ago
I remember when beacons were recently discussed here, someone mentioned the fetchLater API: https://developer.mozilla.org/en-US/docs/Web/API/fetchLater_...
Brysonbw•2d ago
One of my favorite Web APIs
AndrewStephens•2d ago
The beacon API has exactly one use - reliable analytics. Sending a ping on leaving the page is a pretty contrived example - the beacon API is useful at any time.

I use the beacon API in my homebuilt hit-counter. It means that even if the user navigates away before the hit is registered, the request will still have a fair chance of being received by my server.

Of course there are other ways of doing this, but who wants to muck around with service workers or websockets when there is a simple, well-supported API that does exactly what you want?

Thorrez•2d ago
Could you count hits on the server when serving the page?

I guess caching might break that depending on cache settings. And for SPAs, it might not work as desired.

dspillett•2d ago
Calling out as the page closes, assuming you called out at out listed too, tells you how long the user was there. Not entirely reliable of course as they could have opened it in the background so had it open a while before dismissing it without looking at it at all.
Thorrez•1d ago
I should have been clearer. I was replying to the "I use the beacon API in my homebuilt hit-counter." part.
AndrewStephens•2d ago
There are several reasons that you cannot just count the number of times your server has served the page.

The biggest is bots - on my site (and I assume most others), legitimate requests are far, far outweighed by bots. Sometimes you can tell that they are bots but it is very common for bots to pretend to be real users. Oftentimes you can't tell from a single request but only but looking at the pattern of requests.

Some bots do take the trouble of running scripts on the page but thankfully they are in the minority so far.

Caching would certainly break the system as well, in the other direction.

immibis•1d ago
Why do we automatically suppose that bot requests are "not legitimate" btw?
wredcoll•1d ago
For the same reason we assume a random tiger wants to eat us.
meindnoch•1d ago
That's tigrophobic.
baxuz•2d ago
One downside is that it's not available in web workers.
LunaSea•2d ago
Is the Beacon API functional nowadays? I remember that a two or three years ago benchmarks showed that the original window.onunload (I believe) was able to log more event than the new Beacon API.
jauntywundrkind•2d ago
One concern I have is that interactions on sites like HN might not have gotten to the server. Wouldn't this be useful to make sure something like an upvote gets through, even if I navigate away quickly?
stevage•1d ago
>Sending a ping on leaving the page is a pretty contrived example

I don't think it's a contrived example. It seems to be one of the main use cases. From the spec:

> The main use case for the Beacon API is to send analytics such as client-side events or session data to the server. Historically, websites have used XMLHttpRequest for this, but browsers do not guarantee to send these asynchronous requests in some circumstances (for example, if the page is about to be unloaded). To combat this, websites have resorted to various techniques, such as making the request synchronous, that have a bad effect on responsiveness. Because beacon requests are both asynchronous and guaranteed to be sent, they combine good performance characteristics and reliability.

lapcat•2d ago
[self-promotion:] My Safari extension StopTheMadness Pro disables the Beacon API.
srameshc•2d ago
Interesting. Could you elaborate on the rationale behind disabling the Beacon API?
vinnymac•2d ago
Not OP. It’s mostly used for tracking user behavior, and is rarely critical functionality for a given web page.
snickerdoodle12•2d ago
It's solely created for advertisers to be able to implement their tracking more reliably. There is almost no way to use it in a way that benefits the user.
Chabsff•2d ago
Yes, but you could also say that it was created so that advertisers stop doing complete nonsense like tracking pixels and other roundabout ways of accomplishing the same thing in ways that are sometimes (often?) detrimental to the user.

Sure, it's a form of capitulation to advertisers, that doesn't necessarily mean that it doesn't benefit the user.

If advertisers are going to be doing that stuff no matter what, corralling them has advantages. If anything, it makes creating an extension like OP's a lot easier than playing whack-a-mole with a litany of random techniques.

snickerdoodle12•2d ago
Sure, which is exactly the rationale for disabling it.
zenethian•2d ago
You're a hero, and I love your extension. Thank you for all of your hard work.
paultopia•2d ago
How about don't instead
junon•2d ago
> Maybe it’s for for analytics or even auto-logout when they leave the website.

Yeah, don't do either of these things. Don't log me out when I close the tab. Don't spy on me after I close the tab.

Very simple!

afavour•2d ago
> Don't spy on me after I close the tab.

Maybe a small nit but it isn't spying on you after you close the tab. It is spying on you the moment you close the tab and no later.

junon•2d ago
If it's performing a request upon closing the tab, only two options are available:

1. it delays closing until it completes, which is a performance hit, or

2. it's performing more website specific background work when I've told the browser not to by hitting the Close Tab button.

subscribed•1d ago
Interrupt the request, clean up after the tab.

That's all. The second option is garbage collector. Not sure why the website is entitled to execute any code when I decided to close it.

01HNNWZ0MV43FF•1d ago
Don't spy on me
hdjrudni•13h ago
> Don't log me out when I close the tab.

What about being logged out of a real-time chat with your friend? Wouldn't you like them to know you are no longer connected? Or do you prefer to trick them with a little green 'connected' bubble that can no longer update?

vince14•2d ago
Their fetch call is missing `keepalive: true`.

    When set to true, the browser will not abort the associated request if the page that initiated it is unloaded before the request is complete. This enables a fetch() request to send analytics at the end of a session even if the user navigates away from or closes the page.
https://developer.mozilla.org/en-US/docs/Web/API/RequestInit...
righthand•2d ago
Can I disable this in my Chrome browser? I don’t want tracking companies to have more convenience.

In Firefox you can disable it by beacon.enable = false.

Hnrobert42•2d ago
Could you send the beacon every five minutes? When the beacon stops coming in for 30 minutes assume that the tab closed or the user went off-line.
ivanjermakov•2d ago
> every five minutes

This is tricky in JavaScript, because timers are asleep/throttled in inactive tabs: https://developer.mozilla.org/en-US/docs/Web/API/Window/setT...

And if onbeforeleave analytics is not evil, doing stuff in inactive tabs is certainly is.

hoppp•1d ago
You could just have a websocket open then. But its unreliable because if the user's internet cuts out maybe they still on the tab, so watching websocket disconnect is not perfect either
daveoc64•2d ago
I was thinking this might be useful for locking records while users are looking at them, but that's probably better served with a periodic ping that ends when the user leaves the page.
afavour•2d ago
Interesting to see so much resistance to the Beacon API. I think it's great. I've gotten a lot of useful data over the years via user analytics and routing all analytics requests through a dedicated API makes it trivial for users who care to disable it.
wrsh07•2d ago
Something many people refuse to believe is that "understanding your users" doesn't have to be nefarious or about serving ads.

It's important to realize that key assumptions your app makes (nobody is accessing my b2b saas app from a phone) are incorrect. It's important to understand user workflows.

There are higher touch ways to do this (user research is great!), and you should let users opt out, but someone trying to improve the user experience also needs to understand how users are defying their expectations

dmvjs•2d ago
this isn't new at all, ten years ago I used it to open an Android app without a user gesture https://paul.kinlan.me/deep-app-linking-on-android-and-chrom...
chaz6•2d ago
In networking, there is a similar concept called "dyinggasp" in which a device will send a signal when power is lost. This can help the operator determine if a service is likely to be down due to a power failure or a signal interruption.
hoppp•1d ago
I didn't know it existed, it is handy
stevage•1d ago
I tried to figure out how much data you can send exactly. It's not very clear from the spec:

> If the amount of data that can be queued to be sent by keepalive enabled requests is exceeded by the size of transmittedData (as defined in HTTP-network-or-cache fetch), set the return value to false and terminate these steps.

Does anyone know?

mediumsmart•1d ago
Bye JavaScript.