Jump to content

Multiple output CEF to js client


Recommended Posts

Hey guys,

I tried to trigger an event from CEF to client-side Javascript. It worked, but the event triggers 4x rather than just 1x.
At the CEF apparently, not, because that triggers only 1x, I have tested.
Nevertheless, 4 chatbox outputs arrive when I execute the following code...
Does anyone have any idea what this could be?


	<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
	<link rel="stylesheet" href="style.css">

	<div class="all">
		<div class="Testdiv" id="TestDiv1"></div>
          document.getElementById("TestDiv1").addEventListener('click', function (event) {
            mp.trigger('testEvent1', event);
            var elem = document.getElementById("TestDiv1");

Clientside Script

mp.events.add('testEvent1', (testArg1) => {
	mp.gui.chat.push("Testtext: " + testArg1);

I also tried an alternative spelling in the script part of the HTML / Javascript code

$('#Testdiv').click(() => {
  mp.trigger('testEvent1', "Blabla");



Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...