It has so happened that a Russian Q&A resource on IT topics is quite popular in the CIS â . However, something was missing when I started getting to know it better. This led to an improvement in the form of a browser extension. Meet it.
Key features:
- Name: Toster Comfort.
- User statistics: the percentage of questions with solutions; karma from Habr; a summary from the profile â all this is in the list of Toaster questions.
- Notifications: in real time on the site, on the icon, plus push notifications, many settings, the site must be open ().
- Filters: conditions based on formulas: you can hide questions, color them, as well as show notifications â all this is flexibly set up in the form of logical conditions ().
- Interface: small improvements, for example, showing exact dates or displaying subscription status in the question list.
- Habr interface: small improvements (optional), for example, lines for indentation in comments.
- Open source: you can modify it for yourself if you really want to ().
- Free: MIT License.
- Platform: , .
- Memory consumption: 30-50MB, depending on options and usage intensity of Toaster
- Size: 93KB for v0.8.1 (unpacked, non-minimized code).
- Framework: none, pure JS (minimalism).
- Code quality: average, mixed styles, large functions, dirty tricks, few comments.
- Permissions:
toster.ru, habr.com, notifications, storage, unlimitedStorage
Initially, the extension was made for myself with one single goal: to show the percentage of user questions where they took the trouble to click the 'Mark as resolved' button. Then little by little, various features were added until the tool grew into a behemoth of a hundred kilobytes. Nevertheless, the principle of 'not using anything extra' was maintained until the end.
One of the main features now is the use of formulas in the settings. With them, you can do practically anything, any wish for managing your attention. The main thing is to know what to want. Hiding, changing colors, and notifications â these are the three main aspects of attention when working with the site. Filtering everything and anything is the key to convenience.
An example of a flexible rule that will allow receiving notifications on a specific topic:
!tag("Bllokimi i reklamave") && !contains(t,"reklam") && contains(t,"bllokim") && !tag("HTACCESS") || containsWord(t,"rkn") || contains(t,"roskomnadzor") || contains(t,"roskompozor") || contains(t,"shtet") || contains(t,"ndaluar") || contains(t,"ndaluar") || contains(t,"pirat") || containsWord(t,"anashkalim") || containsWord(t,"rostelekom") || containsWord(t,"yarovoi") || containsWord(t,"rf") && tag("Rrjetet kompjuterike") = notifySë pari, duhet të them se funksioni eval() nuk duhej përdorur. Prandaj nuk mund të kesh shumë liri. Kështu që më duhej të shkruaj një workaround prej 5 KB kodi, duke përdorur . Kjo, mund të thuhet, është një JS shumë i kufizuar, si për funksionet ashtu edhe për sintaksën.
Kohët e fundit kishte një postim në lidhje me . Nëse e krahasojmë, TE ka një ndërfaqe më të ngrohtë dhe disa funksione që nuk i ka Toster Comfort. Megjithatë, e zgjerimi im fokuson në konsumimin e resurseve. Megjithatë, askush nuk e pengon përdorimin e të dyja zgjatjeve, ato nuk duhet të bien në konflikt.
Në një kuptim, TC duhet të shkruhet nga e para, sepse puna mund të përshpejtohet të paktën dyfish, dhe puna me cache - dhjetëfish, duke hequr localStorage dhe JSON.stringify() dhe duke ndryshuar disa zgjidhje arkitekturore. Por kjo do të jetë një sakrificë që nuk më takon mua. Unë jam mbështetës i parimit "punon - mos e prek". Deri atëherë, duke pritur, aktivisht pranoj issues dhe PR, por jo në dëm të minimalizmit. Faleminderit për vëmendjen!
Burimi: habr.com
