Advertisement
Guest User

4chan X /lgbt/ flag fix

a guest
Jun 1st, 2023
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.       // Installation instructions: Open the 4chan-X userscript in the editor. Hit ctrl+f and search for "if (g.BOARD.config.board_flags) {" and paste the contents of this pastebin into the previous line
  2.       // If there are no board flags declared, but we can see that the flag selector exists, then we know that we have to add them ourselves.
  3.       if ((g.BOARD.config.board_flags == null) && document.getElementsByClassName("flagSelector")[0].options) {
  4.         console.log("Board flags not declared. Using workaround.");
  5.         // create board flags object
  6.         g.BOARD.config.board_flags = {};
  7.         // go through the options in the flag dropdown menu and add them to the list
  8.         for (let cOption of document.getElementsByClassName("flagSelector")[0].options) {
  9.           g.BOARD.config.board_flags[cOption.value] = cOption.textContent;
  10.         }
  11.         // delete the "None" option
  12.         delete g.BOARD.config.board_flags["0"];
  13.         console.log("Detected the following flags: ", g.BOARD.config.board_flags);
  14.       }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement