How to autofill forms on Google web page?

My goal is to have the comments made by users on my website entered into the review section of my business on Google if they approve the comments. To make it easier for users, I plan to automatically fill in the ratings and comments given on my site into the Google Maps review panel. This way, users can publish the review if they wish.

function submitReview() {
        const rating = document.getElementById('rating').value;
        const comment = document.getElementById('comment').value;
        const google_maps_link = 'https://search.google.com/local/writereview?placeid=ChIJB6t1ora3yhQR9iK05hs-Y0g';

        if (rating === '5') {
            Swal.fire({
                title: 'Bizi Google'da değerlendirir misiniz?',
                text: "Yorumunuz bizim için değerli!",
                icon: 'question',
                showCancelButton: true,
                confirmButtonColor: '#3085d6',
                cancelButtonColor: '#d33',
                confirmButtonText: 'Evet, değerlendiririm!'
            }).then((result) => {
                if (result.isConfirmed) {
                    window.location.href = google_maps_link;
                }
            });
        } else {
            Swal.fire({
                icon: 'success',
                title: 'Yorumunuz kaydedildi!',
                text: 'Yorumunuz için teşekkür ederiz.',
            });
        }
    }

I have tried a few different code structures, one of which is this:

localStorage.setItem('reviewComment', comment);

I add this block of code just before the redirection process to store the comment in memory.

if (window.location.href.includes('search.google.com/local/writereview')) {
        (() => {
            const selector = 'div[aria-label="Beş yıldız"]';
            const topics = document.querySelectorAll(selector);

            setTimeout(() => topics.click(), 1000);
        })();
    }

I then wait for this method to work. However, Google is blocking my JavaScript code. Is there an easier way to implement this structure?