Habr: Return the votes

Returns votes under comments

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