The class RandomPage is extended in extension, but the class is not part of the stable policy and that does not allow to extend it.
I am not sure what the best way is for the extension
I am not sure if it is okay to extend inside core for core special pages
https://codesearch.wmcloud.org/search/?q=extends%5Cs%2BRandomPage%5Cb&i=nope&files=&repos=