Would it be possible for the ".onion available" pill to appear sooner?

This button gets generated when the ‘Onion-Location’ HTTP header is found. However, it seems that the ‘document’ file with the header needs to finish loading fully before this information is available. You can also see this in the ‘Network’ tab of the DevTools menu: click on the request with the ‘document’ initiator while a website is loading, and you’ll see that the ‘Headers’ tab is only filled in once it fully finished loading.

This leads to unfortunate behavior, especially when you’ve set Tor Browser to always prioritize .onion sites: it will wait for the initial request to finish loading completely, which could take, like, 20 seconds on a bad connection, and once the site has finally loaded, it’ll visit the onion service, which will again take about 20 seconds.

I’m not sure how HTTP requests work exactly, but I was wondering if it would be possible to redirect or show the button as soon as it receives the Onion-Location header in the stream of data. If the header is the first part of the data that arrives, then this could lead to significant speedups.

I agree, the current behavior of onion-location is not ideal in this regard – especially if the clearnet page is loading particularly slowly (either due to some stubborn resource, low bandwidth or a slow circuit). We have a ticket open to track this issue here, and would welcome any contributions to it ^^


That’s good to hear. I’m quite busy studying lately, but if I’ve got some free time I might give it a shot. It sounds like a ‘good first issue’ :slight_smile:


This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.