Top-of-the-line issues that has occurred to the person expertise on the internet has been net extensions. Browsers are highly effective, however extensions carry a brand new stage of performance. Whether or not it is crypto wallets, media gamers, or different in style plugins, net extensions have turn out to be important for each day duties.
Working at MetaMask, I discover myself immersed in a world the place every little thing Ethereum-centric works. A kind of options is to make sure that .eth
Domains resolve to ENS when entered within the deal with bar. Requests for https://vitalik.eth
naturally fails, since .eth
just isn’t a natively supported top-level area, so we have to intercept this failed request.
// Add an onErrorOccurred occasion by way of the browser.webRequest extension API browser.webRequest.onErrorOccurred.addListener((particulars) => { const { tabId, url } = particulars; const { hostname } = new URL(url); if(hostname.endsWith('.eth')) { // Redirect to wherever I would like the person to go browser.tabs.replace(tabId, { url: `https://app.ens.domains/${hostname}}` }); } }, { urls:(`*://*.eth/*`), sorts: ('main_frame'), });
Internet extensions present a browser.webRequest.onErrorOccurred
methodology that builders can hook up with to pay attention for failed requests. This API does No catch 4**
and 5**
response errors. Within the earlier case we search for .eth
hostnames and redirect to ENS.
you possibly can use onErrorOccurred
for a number of causes, however detecting customized hostnames is nice!
5 Superior New Mozilla Applied sciences You have By no means Heard Of
My journey to Mozilla Summit 2013 was unbelievable. I spent a lot time specializing in my challenge that I had overpassed all the good work the Mozillians have been doing. MozSummit offered the proper reminder of how sensible my colleagues are and the way a lot…