Habr: Return the votes

Returns votes for comments

目前为 2024-02-05 提交的版本。查看 最新版本

// ==UserScript==
// @name            Habr: Return the votes
// @name:ru         Хабр: Верните голоса
// @description     Returns votes for comments
// @description:ru  Возвращает голоса для комментариев
// @namespace       com.habr.askornot
// @license         WTFPL
// @author          askornot
// @match           https://habr.com/*
// @version         0.0.1
// @compatible      chrome     Violentmonkey 2.18.0
// @homepageURL
// @supportURL
// @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;
        },
      });
    },
  });
})();