Ignore low downvotes on own post

Zeros out low down votes for your own post.

  1. // ==UserScript==
  2. // @namespace https://trajano.net
  3. // @name Ignore low downvotes on own post
  4. // @version 1
  5. // @locale en
  6. // @description Zeros out low down votes for your own post.
  7. // @include https://stackoverflow.com/*
  8. // @grant none
  9. // @license EPL-2.0
  10. // ==/UserScript==
  11. (function() {
  12. 'use strict';
  13. const whoami = document.querySelector("#user-profile-button").href
  14. if (document.querySelector("#question .post-signature.owner a").href == whoami) {
  15. const voteElement = document.querySelector("#question div.js-vote-count")
  16. const score = parseInt(voteElement.textContent)
  17. if (score > -10 && score < 0) {
  18. voteElement.textContent = "0"
  19. }
  20. }
  21.  
  22. })();