London Escorts sunderland escorts 1v1.lol unblocked yohoho 76 https://www.symbaloo.com/mix/yohoho?lang=EN yohoho https://www.symbaloo.com/mix/agariounblockedpvp https://yohoho-io.app/ https://www.symbaloo.com/mix/agariounblockedschool1?lang=EN
0.8 C
New York
Wednesday, January 29, 2025

The right way to Detect Failed Requests by way of Net Extensions


Among the finest issues that ever occurred to t he person expertise of the online 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 grow to be important to day by day duties.

Engaged on MetaMask, I’m thrust right into a world of constructing every little thing Ethereum-centric work. A kind of functionalities is making certain that .eth domains resolve to ENS when enter to the tackle bar. Requests to https://vitalik.ethnaturally fail, since .eth is not a natively supported high stage 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 person to go
    browser.tabs.replace(tabId, { url: `https://app.ens.domains/${hostname}}` });
  }
},
{
  urls:[`*://*.eth/*`],
  sorts: ['main_frame'],
});

Net 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!

  • 6 Things You Didn’t Know About Firefox OS

    Firefox OS is everywhere in the tech information and for good motive:  Mozilla’s lastly given net builders the platform that they should create apps the best way they have been creating them for years — with CSS, HTML, and JavaScript.  Firefox OS has been quickly enhancing…

  • From Webcam to Animated GIF: the Secret Behind chat.meatspac.es!

Related Articles

Social Media Auto Publish Powered By : XYZScripts.com