// Wait for the DOM to be ready
document.addEventListener("DOMContentLoaded", function() {
// Get the button element by its ID
var button = document.getElementById('controlnetbutton-1');
// Check if the button element exists
if(button) {
// Add a click event listener to the button
button.addEventListener('click', function() {
// Trigger the click event of the button on the other page
triggerButtonClickOnOtherPage();
});
}
// Function to trigger the button click on the other page
function triggerButtonClickOnOtherPage() {
// You need to replace 'other-page-button-id' with the ID of the button on the other page
var otherPageButton = document.getElementById('controlnetbutton');
// Check if the button on the other page exists
if(otherPageButton) {
// Trigger a click event on the button
otherPageButton.click();
} else {
console.error('Button on the other page not found!');
}