Dialogic Systems GmbH & Co. KG

Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

JavaScript für Embedded Browser, führt einen Autologin durch und klappt die seitlichen Menüs weg.


PASSWORD und USERNAME mit den Korrekten Daten ersetzen.

Code Block
languagejs
titleVivotek ND9326P
var usernameInput = document.getElementById('username');
  var passwordInput = document.getElementById('password');

  if (usernameInput) {
    usernameInput.value = 'USERNAME';
    usernameInput.dispatchEvent(new Event('input', { bubbles: true })); // Simuliere Eingabe
  }

  if (passwordInput) {
    passwordInput.value = 'PASSWORD';
    passwordInput.dispatchEvent(new Event('input', { bubbles: true })); // Simuliere Eingabe
  }

  var loginButton = document.querySelector('button[data-testid="login-button"]');
  if (loginButton) {
    loginButton.click(); // Optional: Automatisches Klicken auf den Button
  }

var iconContainerRight = document.querySelector('div.icon-container.svg-icon.toggler.general_arrow_right');
  
  if (iconContainerRight) {
    iconContainerRight.focus();

    var clickEvent = new MouseEvent('click', {
      bubbles: true,
      cancelable: true,
      view: window
    });
    iconContainerRight.dispatchEvent(clickEvent);
    iconContainerRight.dispatchEvent(new MouseEvent('mousedown', { bubbles: true, cancelable: true }));
    iconContainerRight.dispatchEvent(new MouseEvent('mouseup', { bubbles: true, cancelable: true }));

    console.log("Click event dispatched on 'general_arrow_right'.");
  } else {
    console.log("Element 'general_arrow_right' not found.");
  }

  // Finde das Element mit der Klasse 'general_arrow_left'
  var iconContainerLeft = document.querySelector('div.icon-container.svg-icon.toggler.general_arrow_left');
  
  if (iconContainerLeft) {
    iconContainerLeft.focus();

    var clickEventLeft = new MouseEvent('click', {
      bubbles: true,
      cancelable: true,
      view: window
    });
    iconContainerLeft.dispatchEvent(clickEventLeft);
    iconContainerLeft.dispatchEvent(new MouseEvent('mousedown', { bubbles: true, cancelable: true }));
    iconContainerLeft.dispatchEvent(new MouseEvent('mouseup', { bubbles: true, cancelable: true }));

    console.log("Click event dispatched on 'general_arrow_left'.");
  } else {
    console.log("Element 'general_arrow_left' not found.");
  }

...