Question / Help Browser Interaction on refresh.

NvMedia

New Member
I am looking for a way to add to the following that ON PAGE LOAD the script in HTML file runs and simulates a left mouse click to bypass need for interact every single time..
I have the following but not able to add the necessary code..

HTML:
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
</head>
<title>TEST -</title>
<div id="target">
<iframe style="max-width: 100%; display: block; margin: auto;" src="https://www.mintv.com/home/ejwM/48/" autoplay="" width="1920" height="1080" frameborder="0" scrolling="no" align="middle" webkitallowfullscreen mozallowfullscreen allowfullscreen</iframe>
</div>
<script>
$('#target')[0].click();
</script>
  </body>
    </html>

as well as:

HTML:
<html>
<head>
<style>
iframe{width:100vw;height:100vh;border:0}
</style>
<script>
function on.PageLoad(){(function(){document.body.firstElementChild.src+="",click()},3000)}click();
</script>
</head>
<body>
<iframe src="https://www.ministeriotv.com/home/ejwM/48/"></iframe>
</body>
</html>

either work..
 

koala

Active Member
Your script clicks too soon. The content of the iframe is probably not even started to load when the click is generated. Such things are done asynchronously, for example quick and dirty with the help of SetTimeout(...). Use a timeout of perhaps 1000ms to 2000ms. It can also been done right with the help of events, as complex and lengthy as you want, but quick and dirty is probably the most easy approach.
 

NvMedia

New Member
Your script clicks too soon. The content of the iframe is probably not even started to load when the click is generated. Such things are done asynchronously, for example quick and dirty with the help of SetTimeout(...). Use a timeout of perhaps 1000ms to 2000ms. It can also been done right with the help of events, as complex and lengthy as you want, but quick and dirty is probably the most easy approach.
sorry which code are you refering to? the second set? that is set to 3000...
the other is not using or mentioning time.
 

NvMedia

New Member
ok what am I missing here??

HTML:
<!DOCTYPE html>
<html>
<body>

<iframe style="max-width: 100%; display: block; margin: auto;" src="https://www.minitv.com/home/ejwM/48/" width="1920" height="1080" frameborder="0" scrolling="no" align="middle" webkitallowfullscreen mozallowfullscreen allowfullscreen</iframe>
</div>

<body onload="javascript:myFunction()">

<script>
function myFunction() {
  setTimeout(function(.click){;}, 3000);
}
</script>

</body>
</html>
 

koala

Active Member
I'm unable to help any further. You might want to ask in some Javascript-specific forum. It's out of scope here.
 

koala

Active Member
OBS Studio being open source doesn't mean it's appropriate to discuss arbitrary topics in its support forum.
Apart from that, I'm in no position to declare topics closed - you can certainly continue to look for a solution here, but I recommend you find and go to some Javascript-specific help site. Perhaps Stackoverflow is something: https://stackoverflow.com/questions. Whenever I was looking for small code snippets for coding something best-practice, I found it there. It wasn't even necessary to ask - it was all already answered before.
 

NvMedia

New Member
OBS Studio being open source doesn't mean it's appropriate to discuss arbitrary topics in its support forum.
Apart from that, I'm in no position to declare topics closed - you can certainly continue to look for a solution here, but I recommend you find and go to some Javascript-specific help site. Perhaps Stackoverflow is something: https://stackoverflow.com/questions. Whenever I was looking for small code snippets for coding something best-practice, I found it there. It wasn't even necessary to ask - it was all already answered before.
I agree - arbitrary stuff is indeed inappropriate. Not sure this qualifies as inappropriate. I thought this forum would perhaps provide insight or a method to do what I am asking which is essentially using browser input - interact with it - and just click it in an automated fashion. I thought that the HTML may have been the easiest way - however if there is a way to automate interaction in OBS that would be great to.
Essentially a modification of the youtube script that is out there for OBS to be able to do this would be Excellent!
I thank you for your recommendation - I have searched there AND posted onto that forum as well. (https://stackoverflow.com/questions...ate-a-mouse-click-on-an-iframe-embedded-video)
 
Top