Idk if it worked like this before but the Statistics Query is flawed. Only the first 13k of 18k Anime and the first 46k of 95k Manga will be selected. To fix this this anyone can just save the linked HTML file and edit the script in it. In the SiteStatistics query just add a (sort:COUNT_DESC) after anime or manga based on the file you are editing.
Should look something like this (without new lines and tabs; for manga button it is manga instead of anime):
SiteStatistics{ anime(sort:COUNT_DESC){ nodes{ count } } }
You also should change the selectedAnime variable below. The Index should be 0 instead of the the last element. So looking like this (also Math.ceil so you can get the last entries too):
var selectedAnime = Math.ceil(Math.random()*data.data.SiteStatistics.anime.nodes[0].count);
Just save the changes and you can open the file with your browser and it will navigate to a random manga/anime.
With those 2 little changes all modern Anime and Manga will be picked too. ^^
Here are some temporarily working links. The files have to be saved and then renamed to .html instead of txt (couldn't upload a html file):
Anime
Manga
Edit: The txt files work as html too for me so you have some temporarily working buttons here. xD
Edit 2: Just for fun i made a more interactive website (totally ugly) to generate mutliple random manga and anime links with the title and you can select if adult content should be included:
Random List
Btw how did you figure it out that it was working not including everything?
I worked with the AniList API recently for a private browser plugin. I was interested what the HTML does and looked into the query and noticed it. I checked the API response and saw that one of the first recorded anime and manga counts is used instead of the newest. So for example half of all Manga couldn't even be found with those random buttons.
For fun i just edited to exclude manga and anime with the Adult flag .. maybe anyone is interested. xD