Topic on Extension talk:MobileFrontend

Is there anyway to detect page in or not in Mobile mode?

2
Deletedaccount4567435 (talkcontribs)

Hi,

We are trying to add JavaScript A when user visiting Desktop page, and add JavaScript B when Mobile page. We can successfully add JS file with BeforePageDisplay hook now. But can't detect the status.

Is there any way to distinguish between Viewing status (some ways to get a if/else statement status ) from Desktop and Mobile?

Thank you!


Peter Bowman (talkcontribs)

Perhaps check the wgMFAmc JS config variable, see source code.

Reply to "Is there anyway to detect page in or not in Mobile mode?"