Habr: Return the votes

Returns votes under comments

اعتبارا من 05-02-2024. شاهد أحدث إصدار.

// ==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.2
// @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;
        },
      });
    },
  });
})();