<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Erisan Olasheni</title>
    <description>The latest articles on DEV Community by Erisan Olasheni (@olasheni).</description>
    <link>https://dev.to/olasheni</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F89548%2Fdfdab090-255a-45af-add5-1990eeda3d67.jpg</url>
      <title>DEV Community: Erisan Olasheni</title>
      <link>https://dev.to/olasheni</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/olasheni"/>
    <language>en</language>
    <item>
      <title>How to Use AVIF images</title>
      <dc:creator>Erisan Olasheni</dc:creator>
      <pubDate>Mon, 09 Nov 2020 13:23:38 +0000</pubDate>
      <link>https://dev.to/olasheni/how-to-use-avif-images-14p1</link>
      <guid>https://dev.to/olasheni/how-to-use-avif-images-14p1</guid>
      <description>&lt;p&gt;In this tutorial, we shall be talking about a new way to distribute images better. The technology world is restless in providing better ways to serve media across. Images are apparently the most common media anywhere in the world, as a result, this has brought about many formats to represent it better. The most popular formats include JPEG, PNG, GIF, WEBP and .... but wait, AVIF! — the newcomer!&lt;/p&gt;

&lt;h2&gt;
  
  
  What Is AVIF?
&lt;/h2&gt;

&lt;p&gt;AVIF stands for AV1 Image Format, as at the time of this writing, AVIF is the newest acceptable image format on earth. It is an extraction of frames from the now popular &lt;a href="https://en.wikipedia.org/wiki/AV1"&gt;AV1 video&lt;/a&gt; stored in the &lt;a href="https://en.wikipedia.org/wiki/High_Efficiency_Image_File_Format"&gt;HIEF file format&lt;/a&gt;. AVIF is created by &lt;a href="http://aomedia.org/"&gt;Alliance for Open Media (AOM)&lt;/a&gt;, the same organization that developed the AV1 video, with contributions from other tech giants like Google and Apple.&lt;/p&gt;

&lt;p&gt;The purpose of creating AVIF is to provide images with better compression efficiency and more feature support compared to the existing image formats and it has just spelled the need. AVIF is royalty-free, making it easy for you and me to adopt. &lt;a href="https://github.com/AOMediaCodec/av1-avif/releases"&gt;AVIF version 1.0.0 was released&lt;/a&gt; in February of 2019.&lt;/p&gt;

&lt;h2&gt;
  
  
  What This Means for a Web Developer?
&lt;/h2&gt;

&lt;p&gt;As a web developer, this is just a new way to serve your content better and lighter to your users. The web page comprises about 51% media, having images claiming the larger portion of it, and because images claim the bigger part of a web page size, AVIF is just a solution to drastically improve your web pages speed, which also means a change to user satisfaction and SEO in whole.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Choose AVIF?
&lt;/h2&gt;

&lt;p&gt;Whether you are a developer, blogger, or graphic artist, here are a few of the many reasons you should fall in love with AVIF:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Currently backed by the giants in tech like Google, Amazon, Netflix, Microsoft, and more.&lt;/li&gt;
&lt;li&gt;  It is royalty-free, free to use for everyone without paying.&lt;/li&gt;
&lt;li&gt;  It currently allows the highest compression possible.&lt;/li&gt;
&lt;li&gt;  Because it’s just a frame extraction from AV1 video, it also ships with the features provided by AV1 video codec, these include transparency, HDR, wide color gamut, and more.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A greater chance that AVIF will be the next big thing for media because of its extreme gap in compression size, experiments show that AVIF could save up to 80% less than the other known formats.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Create Images AVIF format?
&lt;/h2&gt;

&lt;p&gt;The easiest way to create images in AVIF format is to convert your old files to AVIF format first, having the .avif file extension. Don’t worry, this is simpler than you think. Because AVIF is new, there are few to zero application software that currently offers this, but I am happy to tell you that there’s an online solution. &lt;a href="https://avif-converter.online/"&gt;This online AVIF converter&lt;/a&gt; is currently the fastest converter available to quickly transfigure your old formats to AVIF. All you need to do is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Visit the &lt;a href="https://avif-converter.online/"&gt;Online converter&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Upload your old formats (can be PNG, JPEG or GIF).&lt;/li&gt;
&lt;li&gt;Wait while it processes on the server.&lt;/li&gt;
&lt;li&gt;Download and save your new  AVIF files.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Use AVIF on your Website
&lt;/h2&gt;

&lt;p&gt;Even though AVIF has been adopted almost by all web browsers, because of its new age, chances are that your users current browser might not have been update yet, it is still necessary to use &lt;strong&gt;content negotiation&lt;/strong&gt; when importing AVIF on your websites:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;picture&amp;gt;&lt;/span&gt;
&lt;span class="c"&gt;&amp;lt;!-- use AVIF image if the browser supports it --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;source&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"image/avif"&lt;/span&gt; &lt;span class="na"&gt;srcset=&lt;/span&gt;&lt;span class="s"&gt;"sample.avif"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="c"&gt;&amp;lt;!-- in case the browser does not support AVIF --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"A Fallback image"&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"sample.jpg"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/picture&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  AVIF Support
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;  Chrome 85 is the first browser to fully support AVIF, starting from the &lt;a href="https://developers.google.com/web/updates/2020/08/nic85#more"&gt;Chromium version 85, released in August 2020&lt;/a&gt;. &lt;/li&gt;
&lt;li&gt;  Mozilla is working on support for the image format in Firefox.[155] Cloudflare announced AVIF support in a blog post on 3 October 2020.&lt;/li&gt;
&lt;li&gt;  Microsoft also included support for AVIF in the &lt;a href="https://www.howto-connect.com/windows-10-1903-version-support-avif-file-type/"&gt;Windows 10 "19H1" updates&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I want to believe that you are now convinced to start using AVIF in your next projects, what about your previous projects? Make your web pages media lighter now by using the latest image format, let me know your opinion in the comments below!&lt;/p&gt;

</description>
      <category>avif</category>
      <category>av1</category>
      <category>images</category>
      <category>webpageoptmization</category>
    </item>
    <item>
      <title>Using target=_blank The Malicious Way</title>
      <dc:creator>Erisan Olasheni</dc:creator>
      <pubDate>Wed, 13 May 2020 08:24:45 +0000</pubDate>
      <link>https://dev.to/olasheni/using-target-blank-the-malicious-way-3bif</link>
      <guid>https://dev.to/olasheni/using-target-blank-the-malicious-way-3bif</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AlcXRsa_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/pu0d6beiwq6csq9ozno4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AlcXRsa_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/pu0d6beiwq6csq9ozno4.png" alt="_blank the Malicious Way"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a rel="noopener noreferrer" href="https://lyty.dev/html/html-link.html"&gt;HTML Links&lt;/a&gt; are the tool that connects your web pages together, and makes it a website. We will be discussing how this great tool can be maliciously used against your website (and maybe your dearly users). This is what many web designers/developers are not aware of.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fun Fact:&lt;/strong&gt; A website is a collection of web pages, that are &lt;strong&gt;linked&lt;/strong&gt; together with URLs and hosted to the server. Links as the name implies links your web pages together, what that also mean is that without web page links there's no web site! We just have chunks of web pages, hugh!&lt;/p&gt;

&lt;h2&gt;
  
  
  That Malicious Story
&lt;/h2&gt;

&lt;p&gt;Anyways, website is not the topic for today but web page links is. When you use a &lt;code&gt;target="_blank"&lt;/code&gt; on your &lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt; &lt;em&gt;(or whatever)&lt;/em&gt; link, the browser will be informed about the old page or the referring page, that sounds okay right??? No! Wait one more thing, the browser can also control the referring page! This is where the problem comes, the browser also provides a &lt;code&gt;window.opener&lt;/code&gt; object which allows you to partially interact with the referring page. This exposes the website to controls like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Run the same process as your web page, running some JavaScript that might affect your page's performance.&lt;/li&gt;
&lt;li&gt;Partially control your web page (the page from which a user opened another page). By redirecting it to a malicious URL.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's Horrible Hugh!&lt;/p&gt;

&lt;p&gt;I know at this time, your possible question would be how then can I avoid this, it's simple! The &lt;a href="https://www.w3.org/TR/2014/REC-html5-20141028/links.html#linkTypes"&gt;rel&lt;/a&gt; attribute came to rescue! How??? Yes, of course we are going to talk about that but before then, let's talk about a more step-by-step case of how an attacker can abuse your links.&lt;/p&gt;

&lt;h2&gt;
  
  
  Some Use Cases
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;You directed a user to an external web page&lt;/li&gt;
&lt;li&gt;The attacker uses some JavaScript on the new page to change the location of the referring page to a phished page that looks exactly like the former web page through &lt;code&gt;window.opener.location&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;The user comes back only to see the same page because there's no significant different from it and the new phished page.

&lt;code&gt;User continues interaction === attacker gains access&lt;/code&gt;

.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Solution
&lt;/h2&gt;

&lt;p&gt;Okay, back to &lt;strong&gt;How&lt;/strong&gt; can I prevent this? The solution for this is to use &lt;code&gt;rel="noopener"&lt;/code&gt; or &lt;code&gt;rel="noreferrer"&lt;/code&gt; on your &lt;code&gt;&amp;lt;a href ...&lt;/code&gt; tags, this blocks the browser from carrying your precious information over to a stranger website.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;rel="noopener", tells the browser not to give information about your website&lt;/li&gt;
&lt;li&gt;rel="noreferrer" I am like my brother, but I also block the HTTP &lt;code&gt;Referrer&lt;/code&gt; from being sent to the header of the new page.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Safe Use
&lt;/h2&gt;

&lt;p&gt;To be sure all is save, always use both the &lt;code&gt;noopener&lt;/code&gt; and &lt;code&gt;noreferrer&lt;/code&gt; values, as it was reported that some browsers does not support the &lt;code&gt;noopener&lt;/code&gt;, but all browsers tend to support the &lt;code&gt;noreferrer&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example
&lt;/h3&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"noopener noreferrer"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://lyty.dev/html/html-link.html"&lt;/span&gt; &lt;span class="na"&gt;target=&lt;/span&gt;&lt;span class="s"&gt;"_blank"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;HTML Links&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;A preview of how this works can be seen on the link in the first paragraph of this page. Feel free to inspect it on your browser to confirm the actions.&lt;/p&gt;

&lt;p&gt;Good As Go!&lt;/p&gt;

</description>
      <category>html</category>
      <category>blank</category>
      <category>links</category>
      <category>websecurity</category>
    </item>
  </channel>
</rss>
