One of the best things to happen to the web user experience is web extensions. Browsers are powerful, but extensions bring new levels of functionality. Whether it’s a cryptocurrency wallet, media player, or other popular plugins, web extensions have become essential for everyday tasks.
Working on MetaMask, I’m thrown into the world of making everything Ethereum-centric work. One of their functions is to ensure that: .eth
The domain resolves to ENS when you type it in the address bar.request to https://vitalik.eth
Of course it will fail, .eth
is not a natively supported top-level domain, so you must intercept this erroneous request.
// Add an onErrorOccurred event via the browser.webRequest extension API browser.webRequest.onErrorOccurred.addListener((details) => const tabId, url = details; const hostname = new URL(url); if(hostname.endsWith('.eth')) // Redirect to wherever I want the user to go browser.tabs.update(tabId, url: ` ); , urls:[`*://*.eth/*`], types: ['main_frame'], );
Web extensions are browser.webRequest.onErrorOccurred
A method that developers can plug in to listen for erroneous requests.This API does the following do not have catch 4**
and 5**
Response error. In the above case, we would ask: .eth
Specify the hostname and redirect to ENS.
you can hire onErrorOccurred
For various reasons, discovering custom hostnames is great.
CSS animations between media queries
CSS animations are right there in sliced bread. CSS animations are efficient because they are hardware accelerated, require no JavaScript overhead, and consist of very little CSS code. Very often we add CSS transformations to elements via CSS…
6 things you didn’t know about Firefox OS
Firefox OS has been all over the tech news, and for good reason. Mozilla finally gives web developers the platform they need to build apps the way they’ve been building them for years: using CSS, HTML, and JavaScript. Firefox OS is rapidly improving…
HTML5 context menu
One of the hidden gems within the HTML5 specification is context menus. The HTML5 context menu specification allows developers to create custom context menus for simple menu elements and specific blocks within menuitem elements. Menu information is on the page…