AO3 HS Fix

Change `width` to `max-width` on Homestuck fics on AO3.

  1. // ==UserScript==
  2. // @name AO3 HS Fix
  3. // @namespace https://greasyfork.org/en/scripts/444424-ao3-hs-fix
  4. // @version 0.2
  5. // @description Change `width` to `max-width` on Homestuck fics on AO3.
  6. // @author You
  7. // @match https://archiveofourown.org/*
  8. // @license MIT
  9. // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function () {
  14. "use strict";
  15.  
  16. // Your code here...
  17. const blocks = document.getElementById("workskin").getElementsByClassName("block");
  18. if (blocks) {
  19. for (let i = 0; i < blocks.length; i++) {
  20. blocks[i].style.width = "unset";
  21. blocks[i].style.maxWidth = "650px";
  22. }
  23. }
  24. })();