OutputPage's instance is passed to method bound to hook - http://www.mediawiki.org/wiki/Manual:Hooks/BeforePageDisplay. Please use it