📜 ⬆️ ⬇️

Who answers you in habratopik. Browser Extension

This is a browser extension that allows you to receive and read new events from the habr, such as replies to your comments in habra-opics.

I have long wanted to implement it, but after reading the comment , I realized that it was time, since the engine was already tested on a similar extension for another site.

While versions for two browsers are made - Chrome and Opera.
')
At the moment, in version 1.0, the minimum is implemented - notification of new comments that are sent to you.

When a new comment arrives, the extension icon flashes with the number of new comments, and when you open the list, you will see a new message marked with a bold background and with a red “New” button. When you click on this button, the message is marked as read. Likewise, the message is marked as read when opening an event link (habratopeka).


You can “delete” (hide) an uninteresting message, if needed. It falls into the "deleted" tab. And already from this tab, they are removed forever.

When entering text in the answer field, you can close the application window at any time. The text is remembered, and you can continue to write the answer at any subsequent convenient time.

The answer through the extension has not yet been implemented, because Habra has a check on Referer when sending a comment, but I will definitely do it in the next versions.

There is a menu for actions with all elements - you can mark as read, delete, restore. This is the triangle to the right of the tabs “new”, “all”, etc.

You can also view information about a user by hovering over a nickname - for now only avatar, karma and rating.

There is a sound on the arrival of new messages, you can turn off.

There is a so-called quiet mode (pause) so that no one distracts. At this time, and traffic decreases, if it is critical (mobile phones). In this mode, no requests are made to the network for new messages, the icon becomes gray and nothing flashes.

There is a display of that own (own) commentary, which was answered by another user, when you click the mouse on the links with the text "replies in habratopik ..." the full text of your comment pops up.

Desktop notification works for Chrome. You can disable - the icon in the upper right corner.

The engine uses a database on sqlite for data storage.

Reverse page used. This allows the messages to be permanently on the same page, no matter how new they appear.

All links are shortened to the minimum possible length with a three-dot in the middle. When cited, they are correctly disclosed in normal full links.

Long entries are folded and scissors are drawn. To view the entire text, click on them.

The extension for Opera is located on my server, so the auto-update is built in according to the standard.

In Opera, there is a limit on the size of the database to 5 MB, so in order to store a lot of information, you can increase this size. It is necessary to open this link in Opera: opera: config # PersistentStorage :
It is necessary to increase the Domain Quota For Widget, the Global Quota For Widget Preferences, the Global Quota For Widget Preferences .
The required minimum for expansion is 1 MB (depending on the volume of correspondence, for 400 comments about 600 KB are needed)

At the very first launch, it will actively work and upload all your comments + answers to them, as well as the users who wrote all this. That is, will spend traffic.

In the future, traffic will be at a level of at least 8 Kb per minute, but usually higher, as those Habratopics in which you participate will be constantly checked for new comments (but usually these are only those that appear on the air).

Habr checks Referer even when taking comments, so Habratopics are taken completely on the html channel, not on ajax, but if Habr removes this check, then the traffic can be reduced to a minimum.

At the request of the habrauser, Funcraft added the ability to sort its comments by karma. Also, I thank him and other habrauser for the initial testing of the extension.

Settings:
  1. You can make it so that when you click on the desktop-notification window, the event link will open, and the event will be marked as read;
  2. The frequency of scanning live, sec - how often to check the live broadcast on the appearance of updated Habratopik, where you commented. Do not put too much time, because then it may not grab Habratopik and miss a comment for you. Although it still exists when rescanning your comments;
  3. The frequency of checking your own new comments, sec - how often to check for the appearance of your own comments on your profile. In fact, it influences the addition of habratopik to the checked list of the live broadcast;
  4. The frequency of rescanning your own comments, sec - once an hour, will scan the entire list of your comments for new comments (for there is a comment count). It was done in order to still find comments for you, if they were skipped through checking the live broadcast - due to the closure of the browser, the lack of the Internet, etc.


I plan to add such alerts and views for QA and private, make the function of Habratopik monitored and much more.

Your wishes are welcome, bug reports too.

Source: https://habr.com/ru/post/145069/


All Articles