The most effective issues that ever occurred to t he person expertise of the online has been internet extensions. Browsers are highly effective however extensions convey a brand new stage of performance. Whether or not it is crypto wallets, media gamers, or different standard plugins, internet extensions have develop into important to on daily basis duties.
Engaged on MetaMask, I’m thrust right into a world of constructing every thing Ethereum-centric work. A kind of functionalities is guaranteeing 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 prime 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 need the person to go browser.tabs.replace(tabId, { url: `https://app.ens.domains/${hostname}}` }); } }, { urls:[`*://*.eth/*`], varieties: ['main_frame'], });
Net extensions present a browser.webRequest.onErrorOccurred
technique 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!
An Interview with Eric Meyer
Your early CSS books had been instrumental in pushing my love for entrance finish applied sciences. What was it about CSS that you just fell in love with and drove you to jot down about it? At first blush, it was the simplicity of it as in comparison with the table-and-spacer…
Serving Fonts from CDN
For optimum efficiency, everyone knows we should put our belongings on CDN (one other area). Together with these belongings are customized internet fonts. Sadly customized internet fonts through CDN (or any cross-domain font request) do not work in Firefox or Web Explorer (appropriately so, by spec) although…
Horny Opacity Animation with MooTools or jQuery
A giant a part of the sexiness that’s Apple software program is Apple’s use of opacity. Like seemingly each different Apple person interface method, it must be ported to the online (</fanboy>). I’ve put collectively an instance of an attractive opacity animation method…