Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 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
- // 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.
- if ((g.BOARD.config.board_flags == null) && document.getElementsByClassName("flagSelector")[0].options) {
- console.log("Board flags not declared. Using workaround.");
- // create board flags object
- g.BOARD.config.board_flags = {};
- // go through the options in the flag dropdown menu and add them to the list
- for (let cOption of document.getElementsByClassName("flagSelector")[0].options) {
- g.BOARD.config.board_flags[cOption.value] = cOption.textContent;
- }
- // delete the "None" option
- delete g.BOARD.config.board_flags["0"];
- console.log("Detected the following flags: ", g.BOARD.config.board_flags);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement