5

I am trying to load iframe on full screen mode, but both firefox and chrome gives warning and full screen is not working. Even the src on iframe is loading from same domain. I have already checked some links on stackoverflow, but none of them is working for me. Followed links:-

  1. firefox Browser rejected fullscreen change
  2. Javascript request fullscreen is unreliable
  3. Capture iframe load complete event

warning by chrome:- Failed to execute 'requestFullscreen' on 'Element': API can only be initiated by a user gesture.

warning by firefox:- Request for fullscreen was denied because Element.requestFullscreen() was not called from inside a short running user-generated event handler.

Roshana Pitigala
  • 8,437
  • 8
  • 49
  • 80
M.Bains
  • 395
  • 1
  • 2
  • 14
  • 1
    I have also tried by using artificial click event on button. **window.top[0].document.getElementsByClassName('Home')[0].click();** but browser blocking the click event with the same warning as above. – M.Bains Mar 14 '18 at 09:35
  • 1
    It has to be a user action in order to trigger the fullscreen mode, I had a similar case with a video player(jPlayer) when a user clicked on play to automatically enter the full screen, for that I've added a `button` and triggered the `click` event from `jQuery` when the user manually clicked the play button. But you cannot automatically trigger the full screen mode without any user interaction – Sabbin Apr 04 '18 at 08:12
  • already answered https://stackoverflow.com/questions/7439503/how-do-i-make-an-iframe-fit-the-entire-screen-without-specifying-dimensions – Narendra Selot Apr 04 '18 at 15:01
  • @NarendraSelot the link that you mentioned not related to above topic. But thanks for your suggestion. – M.Bains Jun 19 '18 at 06:44
  • @Sabbin you are right. – M.Bains Jun 19 '18 at 06:45
  • please post the code you have tried so far – Yvonne Aburrow Jan 15 '19 at 17:28

0 Answers0