Top-of-the-line issues that ever occurred to t he consumer expertise of the online has been internet extensions. Browsers are highly effective however extensions deliver a brand new degree of performance. Whether or not it is crypto wallets, media gamers, or different common plugins, internet extensions have develop into important to daily duties.
Engaged on MetaMask, I’m thrust right into a world of constructing every part Ethereum-centric work. A type of functionalities is guaranteeing that .eth
domains resolve to ENS when enter to the handle bar. Requests to https://vitalik.eth
naturally fail, since .eth
is not a natively supported prime degree area, so we have to intercept this errant 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 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
methodology that builders can plug into to hear 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 possibly can make use of onErrorOccurred
for any variety of causes, however detecting customized hostnames is a good one!
CSS Filters
CSS filter help not too long ago landed inside WebKit nightlies. CSS filters present a way for modifying the rendering of a fundamental DOM factor, picture, or video. CSS filters permit for blurring, warping, and modifying the colour depth of parts. Let’s have…
Being a Dev Dad
I get requested a great deal of questions daily however I am all the time stunned that they are hardly ever questions on code and even tech — most of the questions I get are extra about non-dev stuff like what my workplace is like, what software program I take advantage of, and oftentimes…
Fancy Navigation with MooTools JavaScript
Navigation menus are historically boring, proper? More often than not the navigation menu consists of some imagery with a corresponding mouseover picture. The place’s the originality? I’ve created a flowery navigation menu that highlights navigation gadgets and creates a sequence impact. The XHTML Just a few easy…
Create a Context Menu with Dojo and Dijit
Context menus, utilized in the proper sort of internet software, might be invaluable. They supply shortcut strategies to totally different performance inside the software and, with only a proper click on, they’re available. Dojo’s Dijit frameworks gives a straightforward option to create trendy, versatile context…
Supply hyperlink