Habr: Return the votes

Returns votes under comments

Versione datata 05/02/2024. Vedi la nuova versione l'ultima versione.

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name            Habr: Return the votes
// @name:ru         Хабр: Верни голоса
// @description     Returns votes under comments
// @description:ru  Возвращает голоса под комментариями
// @namespace       com.habr.askornot
// @license         WTFPL
// @author          askornot
// @match           https://habr.com/*
// @version         0.0.3
// @compatible      chrome     Violentmonkey 2.18.0
// @compatible      firefox    Violentmonkey 2.18.0
// @homepageURL     https://greasyfork.org/ru/scripts/486661-habr-return-the-votes/
// @supportURL      https://greasyfork.org/ru/scripts/486661-habr-return-the-votes/feedback
// @run-at          document-start
// @noframes
// ==/UserScript==

(function () {
  'use strict';

  Object.defineProperty = new Proxy(Object.defineProperty, {
    apply(target, _, argumentsList) {
      if (argumentsList[1] !== 'isLoggedIn') return Reflect.apply(...arguments);
      return target(argumentsList[0], argumentsList[1], {
        get() {
          if (
            Object.prototype.hasOwnProperty.call(this, '$options') &&
            this.$options._componentTag === 'TMVotesLever'
          )
            return true;
        },
      });
    },
  });
})();