Probably the greatest issues that ever occurred to t he consumer expertise of the net has been internet 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, internet extensions have turn into important to day by day duties.
Engaged on MetaMask, I’m thrust right into a world of creating all the pieces Ethereum-centric work. A type of functionalities is making certain that .eth
domains resolve to ENS when enter to the deal with bar. Requests to https://vitalik.eth
naturally fail, since .eth
is not a natively supported high stage area, so we have to intercept this errant request.
// Add an onErrorOccurred occasion through 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 consumer to go browser.tabs.replace(tabId, { url: `https://app.ens.domains/${hostname}}` }); } }, { urls:[`*://*.eth/*`], varieties: ['main_frame'], });
Internet extensions present a browser.webRequest.onErrorOccurred
technique that builders can plug into to pay attention for errant requests. This API does not catch 4**
and 5**
response errors. Within the case above, we search for .eth
hostnames and redirect to ENS.
You can make use of onErrorOccurred
for any variety of causes, however detecting customized hostnames is a good one!
The right way to Create a RetroPie on Raspberry Pi – Graphical Information
Right this moment we get to play wonderful video games on our tremendous powered sport consoles, PCs, VR headsets, and even cell gadgets. Whereas I get pleasure from enjoying new video games lately, I do lengthy for the retro gaming methods I had after I was a child: the unique Nintendo…
CSS Animations Between Media Queries
CSS animations are proper up there with sliced bread. CSS animations are environment friendly as a result of they are often {hardware} accelerated, they require no JavaScript overhead, and they’re composed of little or no CSS code. Very often we add CSS transforms to components through CSS throughout…
9 Thoughts-Blowing WebGL Demos
As a lot as builders now detest Flash, we’re nonetheless enjoying a little bit of catch as much as natively duplicate the animation capabilities that Adobe’s previous expertise offered us. In fact we have now canvas, an superior expertise, one which I highlighted 9 mind-blowing demos. One other expertise out there…
Create Twitter-Fashion Dropdowns Utilizing MooTools
Twitter does some nice stuff with JavaScript. What I actually recognize about what they do is that there are not any epic JS functionalities — they’re all easy touches. A type of easy touches is the “Login” dropdown on their homepage. I’ve taken…