Floating Web View

Is it possible to close automatically a floating web view after a determinated time?

I mean to specify a delay time after open the floating web view, and if no shortcut or click is done in the specific delay time, close the floating web view.

Thanks a lot.

Pep

Hi,

<script type="text/javascript">

  var startime = 0;
  var delay = 60; # time after which to auto-close

function BTTInitialize() {
const now = new Date();
window.startime =  now.getTime();
}

  function check_close()
  {
          const now = new Date();
          var remain = now.getTime()-window.startime - delay;
      if (var > 0){
          window.location.href = "bttweb://trigger_named/?trigger_name=&closeFloatingHTMLMenu=1"
      } 

}
   # ask to check if we have to close the page every second
   setInterval(check_close, 1000)

Now if you want that any interaction reset the timer, you just have to update the variable.

Note that i did not tested the above code, this is just to give you the idea and a way to start to implement this. Do not hesitate to post your working example

Olivie

I have done a Floating Web View that closes automatically and I am using it instead of HUD Overlay.

I have shared the code here:

1 Like