How to use ipcRender on remote web app using webview?

I'm currently trying to communicate between a Electron desktop application and web application using webview and ipcRenderer. However, for security reasons, node integration needs to be disabled in the webview. Therefore, I use a preload script to get around this:

Desktop App script:

const webview = document.getElementById("webAppView");
    webview.addEventListener('did-finish-load', () => {
        webview.send("test", "text" )


const {ipcRenderer} = require('electron') 
ipcRenderer.on("test", (event, text) => {

However, this isn't ideal. I want to keep all event listeners for the web application in the web application. Is there any way to move the event listener in preload.js to the guess page like the example given here without enabling nodeintegration on the webview?