<?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: Dima Vishnevetsky</title>
    <description>The latest articles on DEV Community by Dima Vishnevetsky (@dimshik100).</description>
    <link>https://dev.to/dimshik100</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%2F241768%2Fa6388d0c-3463-4756-99b2-4445e3d6a29e.jpeg</url>
      <title>DEV Community: Dima Vishnevetsky</title>
      <link>https://dev.to/dimshik100</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dimshik100"/>
    <language>en</language>
    <item>
      <title>How I built a small and productive Scroll Percentage ↕️ Chrome Extension</title>
      <dc:creator>Dima Vishnevetsky</dc:creator>
      <pubDate>Mon, 01 Jun 2020 08:47:33 +0000</pubDate>
      <link>https://dev.to/dimshik100/how-i-built-a-small-and-productive-scroll-percentage-chrome-extension-ocn</link>
      <guid>https://dev.to/dimshik100/how-i-built-a-small-and-productive-scroll-percentage-chrome-extension-ocn</guid>
      <description>&lt;p&gt;I created a chrome extension to help myself and others better estimate the time and length of an article.&lt;/p&gt;

&lt;p&gt;Here is a quick preview&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/4x18QXkK5Ko"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;This chrome extension was inspired by an idea from Chris coyer in his short article &lt;a href="https://css-tricks.com/how-i-put-the-scroll-percentage-in-the-browser-title-bar/" rel="noopener noreferrer"&gt;How I Put the Scroll Percentage in the Browser Title Bar&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I read many articles online. Some are short and some long (like academic papers). While there are websites like medium.com that help me estimate the time it takes me to read an article, there are still improvements I can make to increase my reading efficiency and general productivity.&lt;/p&gt;

&lt;p&gt;If I'm reading an article and someone needs my attention, with a short glimpse on the active tab I can see how much do I still left to read and I can decide if I'm pausing to address that person or telling him that I need a few more minutes to finish.&lt;/p&gt;

&lt;p&gt;In a different scenario, where I explore some new domain and read multiple articles simultaneously while jumping between them, I can easily see on each tab how much I already read and how much is left. For example, the clear view of how much is left in each article can affect my decision to go to the article that has left the smallest amount of percentage and finish it.&lt;/p&gt;

&lt;p&gt;Here are some screenshots of how I planned it to work.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fjv2pl5hdg2zvg92i90zj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fjv2pl5hdg2zvg92i90zj.png" alt="Scroll Percentage in Tab Title Chrome Extension screenshot"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwrz99x2dfdxlfg2xvqjs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwrz99x2dfdxlfg2xvqjs.png" alt="Scroll Percentage in Tab Title Chrome Extension screenshot - dark mode"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here is a technical description of how I built it.&lt;/p&gt;

&lt;p&gt;The main feature of the extension is a tiny JavaScript block injected into the article page that calculates the scroll position percentage out of the whole page length on each scroll event.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const originalTitle = document.title;

window.addEventListener("scroll", () =&amp;gt; {
  let scrollTop = window.scrollY;
  let docHeight = document.body.offsetHeight;
  let winHeight = window.innerHeight;
  let scrollPercent = scrollTop / (docHeight - winHeight);
  let scrollPercentRounded = Math.round(scrollPercent * 100);
  document.title = `(${scrollPercentRounded}%) ${originalTitle}`;
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The recalculation also works if the page has a lazy loading mechanism.&lt;/p&gt;

&lt;p&gt;The page title updated with the number, and as we know, the page title is also seen on the tabs.&lt;/p&gt;

&lt;p&gt;I also created a pop-up that I can access with a click on the extension icon on the toolbar. In this pop-up, I can manage a list of websites I want this functionality to be active on. The extension updates the list of websites in the synced chrome storage, so when you log in to a new instance of chrome (On a different computer for example), the list is already there.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fr0x3ocs4qyimam8uiwo9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fr0x3ocs4qyimam8uiwo9.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also a small, but essential UX feature is that the extension icon is changing between active and disabled states for every tab, based if the website is in the supported website list.&lt;/p&gt;

&lt;p&gt;Download Link:&lt;br&gt;
&lt;a href="https://chrome.google.com/webstore/detail/scroll-percentage-in-tab/fbohjeijkanpeamijojloonklakpncef?hl=en" rel="noopener noreferrer"&gt;Scroll Percentage in Tab Title Extension&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This project is open-source. I encourage you, junior, and senior developers to participate and contribute to this project. Add feature requests, create pull requests, star ⭐️, fork, and share it to all people you think can benefit from it.&lt;/p&gt;

&lt;p&gt;GitHub link:&lt;br&gt;
&lt;a href="https://github.com/dimshik100/Scroll-Percentage-in-Tab-Title-Chrome-Extension" rel="noopener noreferrer"&gt;https://github.com/dimshik100/Scroll-Percentage-in-Tab-Title-Chrome-Extension&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;More chrome extensions I developed:&lt;br&gt;
&lt;a href="https://chrome.google.com/webstore/detail/passive-aggressive-email/ilobmjgokpmfhhhlhhdkgckmcajdogok" rel="noopener noreferrer"&gt;Passive Aggressive Email Translator&lt;/a&gt;&lt;/p&gt;

</description>
      <category>chrome</category>
      <category>extension</category>
      <category>productivity</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Chrome Tab Hover Card Images</title>
      <dc:creator>Dima Vishnevetsky</dc:creator>
      <pubDate>Tue, 07 Apr 2020 11:14:27 +0000</pubDate>
      <link>https://dev.to/dimshik100/chrome-tab-hover-card-images-1gch</link>
      <guid>https://dev.to/dimshik100/chrome-tab-hover-card-images-1gch</guid>
      <description>&lt;h2&gt;
  
  
  You can see a preview of the page by hovering on its tab.
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nRMEajQ6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dimshik/image/upload/v1586119437/dev.to/Chrome_Tab_Hover_Card_Images/cover_image.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nRMEajQ6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dimshik/image/upload/v1586119437/dev.to/Chrome_Tab_Hover_Card_Images/cover_image.png" alt="Chrome Tab Hover Card Images - preview"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Yes, you read it correctly.
&lt;/h4&gt;

&lt;p&gt;This is the thing you didn't know you always wanted.&lt;/p&gt;

&lt;p&gt;If you are like me and have at least 34 tabs open at any given time, you probably find it somewhat challenging to navigate between them. &lt;br&gt;
About a year ago, Google added a new experimental feature (flag) to Chrome that shows an image preview of a site when you hover its tab. These &lt;strong&gt;"Tab Hover Card Images"&lt;/strong&gt; are similar to how Microsoft implements them in the Edge browser on Windows 10.&lt;br&gt;
This functionality is pretty stable now, and I have been using it for about half a year already.&lt;/p&gt;

&lt;p&gt;So let's get straight to the tutorial because I know you want it.&lt;/p&gt;

&lt;p&gt;First, enable the cards&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fire up Chrome&lt;/li&gt;
&lt;li&gt;Type &lt;code&gt;"chrome://flags"&lt;/code&gt; into the  address bar, then press the &lt;code&gt;"Enter"&lt;/code&gt; key&lt;/li&gt;
&lt;li&gt;type &lt;code&gt;"Tab Hover Cards"&lt;/code&gt; in the search bar&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Or you can enter the following command &lt;br&gt;
&lt;a href="https://dev.tochrome://flags/#tab-hover-cards"&gt;chrome://flags/#tab-hover-cards&lt;/a&gt;&lt;br&gt;
in the address bar of the browser and hit &lt;code&gt;"Enter"&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--f4uAdLvK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dimshik/image/upload/v1586117494/dev.to/Chrome_Tab_Hover_Card_Images/command_in_the_address_bar_1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--f4uAdLvK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dimshik/image/upload/v1586117494/dev.to/Chrome_Tab_Hover_Card_Images/command_in_the_address_bar_1.png" alt="chrome address bar with tab-hover-cards flag command"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here we have our flag setting.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bSgRTd55--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dimshik/image/upload/v1586117493/dev.to/Chrome_Tab_Hover_Card_Images/cards_default.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bSgRTd55--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dimshik/image/upload/v1586117493/dev.to/Chrome_Tab_Hover_Card_Images/cards_default.png" alt="chrome flag - tab hover card default"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From the drop-down menu, a list appears on the right side of the screen and choose either &lt;code&gt;Enabled&lt;/code&gt; to turn it on or &lt;code&gt;Disable&lt;/code&gt; to turn it off.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bosc8ouX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dimshik/image/upload/v1586117493/dev.to/Chrome_Tab_Hover_Card_Images/cards_enabled.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bosc8ouX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dimshik/image/upload/v1586117493/dev.to/Chrome_Tab_Hover_Card_Images/cards_enabled.png" alt="chrome flag - tab hover card enabled"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You might wonder what those &lt;code&gt;"Enabled B"&lt;/code&gt; and &lt;code&gt;"Enabled C"&lt;/code&gt; options. They are in charge of the time it takes for the card to appear after hovering the pointer over the tab.&lt;/p&gt;

&lt;p&gt;If you decide to use only this flag, It will look something like this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8dIkiZDU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dimshik/image/upload/v1586117493/dev.to/Chrome_Tab_Hover_Card_Images/card_preview.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8dIkiZDU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dimshik/image/upload/v1586117493/dev.to/Chrome_Tab_Hover_Card_Images/card_preview.png" alt="chrome flag - tab hover card preview"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But we are here for the cool stuff, so let's add the image preview as well.&lt;/p&gt;

&lt;p&gt;enter the following command &lt;br&gt;
&lt;a href="https://dev.tochrome://flags/#tab-hover-card-images"&gt;chrome://flags/#tab-hover-card-images&lt;/a&gt;&lt;br&gt;
in the address bar of the browser and hit `"Enter". &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TytC_H7w--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dimshik/image/upload/v1586117494/dev.to/Chrome_Tab_Hover_Card_Images/command_in_the_address_bar_2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TytC_H7w--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dimshik/image/upload/v1586117494/dev.to/Chrome_Tab_Hover_Card_Images/command_in_the_address_bar_2.png" alt="chrome address bar with tab-hover-cards-images flag command"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here we have our flag setting again.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3lBCCRW9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dimshik/image/upload/v1586117493/dev.to/Chrome_Tab_Hover_Card_Images/images_default.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3lBCCRW9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dimshik/image/upload/v1586117493/dev.to/Chrome_Tab_Hover_Card_Images/images_default.png" alt="chrome flag - tab hover card images default"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From the drop-down menu, a list appears on the right side of the screen and choose either &lt;code&gt;Enabled&lt;/code&gt; to turn it on or &lt;code&gt;Disable&lt;/code&gt; to turn it off.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oCdd_H2---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dimshik/image/upload/v1586117493/dev.to/Chrome_Tab_Hover_Card_Images/images_enabled.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oCdd_H2---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dimshik/image/upload/v1586117493/dev.to/Chrome_Tab_Hover_Card_Images/images_enabled.png" alt="chrome flag - tab hover card images enabled"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Finally, tap on the &lt;code&gt;"Relaunch"&lt;/code&gt; button to reopen the Chrome browser.&lt;/p&gt;

&lt;p&gt;And here we have it, a preview of every tab we have in a hover of a mouse.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PN_sRQNO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://res.cloudinary.com/dimshik/image/upload/e_loop/v1586254624/dev.to/Chrome_Tab_Hover_Card_Images/image_preview_animated.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PN_sRQNO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://res.cloudinary.com/dimshik/image/upload/e_loop/v1586254624/dev.to/Chrome_Tab_Hover_Card_Images/image_preview_animated.gif" alt="tab hover card images preview"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The current tab will not show a preview image in Tab Hover Cards since it is already showing in the browser window.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>chrome</category>
      <category>tips</category>
      <category>tutorial</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
