Special:Badtitle/NS90:Forum:Wiki Talk/Improved Random Page function

Is it possible to customize the Random Page function? If so, I suggest that it only return Main articles, never subpages. This could be done by checking if the returned page ends with a string associated with subpages (e.g. "/YMMV", "/Characters", "/Playing_With"), cutting off that string, and delivering the resulting page (which logically must be a Main one).