Simple: You can't.
Note: This method must be called while responding to a user interaction or a device orientation change; otherwise it will fail.
Without that restriction, every spam and scam site on the net would be going full-screen as soon as they loaded.
And before you ask: no, there is no way around this restriction. And no,
"it's a requirement from the customer" doesn't change that. :)