0

HTML5 visibilitychange

Hello, I'm trying to display several websites that only work when they are in the foreground. I have several zones for this, each of which contains an HTML5 widget with the external URL of the page. However, only the website that is in the most recently created zone works. I suspect that the Chromium engine only ever marks the HTML5 widget that was created most recently as visible. For testing purposes, it is the same URL in every HTML5 widget. I suspect that Chromium or the page there works with the Javascript property visibilityState or with visibilitychange. I will investigate this further tomorrow. Is there a way to trick every HTML5 widget into thinking it is in the foreground? See also https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API

1 comment

  • 0
    Avatar
    itsme

    Thank you for the answer. However, I was looking for a way to implement this with the HTML5 State/Widget on a BrightSign Player.

    I have since found out that the visibilityState is not the problem at all. It is set to visible when I monitor the visibility change of the document via a js console.log using a js eventListener via a BrightScript JavaScript injection. It is always set to visible. It must be something else. To explain, I tried to automate the login of a page that requires a login via login.microsoftonline.com using a JavaScript injection. This works wonderfully, but only as long as the HTML5 widget zone is the very top one. If not, the login simply remains there. I have now given up on it for now and used sharing the document for "everyone" + password. It works fine there.

    However, I now have a new problem. To explain: I have a full-screen zone with an HTML5 widget in the background. Overlaid on top of this in a small part of the screen is another zone, also with an HTML5 widget. I created the second zone later and it therefore has a higher index. It works so that it overlaps as intended. However, when the website in the back zone reloads, it comes completely to the front and the page from the foreground moves to the background and is no longer visible. How can it be that the page that was loaded last is higher up? I thought the order of the HTML5 widgets was defined by the zones?

Please sign in to leave a comment.