Habr: Return the votes

Returns votes for comments

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

  1. // ==UserScript==
  2. // @name Habr: Return the votes
  3. // @name:ru Хабр: Верните голоса
  4. // @description Returns votes for comments
  5. // @description:ru Возвращает голоса для комментариев
  6. // @namespace com.habr.askornot
  7. // @license WTFPL
  8. // @author askornot
  9. // @match https://habr.com/*
  10. // @version 0.0.1
  11. // @compatible chrome Violentmonkey 2.18.0
  12. // @homepageURL
  13. // @supportURL
  14. // @run-at document-start
  15. // @noframes
  16. // ==/UserScript==
  17.  
  18. (function () {
  19. 'use strict';
  20.  
  21. Object.defineProperty = new Proxy(Object.defineProperty, {
  22. apply(target, _, argumentsList) {
  23. if (argumentsList[1] !== 'isLoggedIn') return Reflect.apply(...arguments);
  24. return target(argumentsList[0], argumentsList[1], {
  25. get() {
  26. if (
  27. Object.prototype.hasOwnProperty.call(this, '$options') &&
  28. this.$options._componentTag === 'TMVotesLever'
  29. )
  30. return true;
  31. },
  32. });
  33. },
  34. });
  35. })();