I'm new on JS. I'm developing a Webview that opens an specific URL. How can I do an action when a specific URL is detected?. I should download a pdf from the URL that is detected. I tried with the the function win.webContents.getURL() but it only showed me the URL of the webpage I want to show.
Thanks!
const { app, BrowserWindow } = require('electron')
const createWindow = () => {
const win = new BrowserWindow({
width: 1024,
height: 1024
})
win.loadURL('https://google.com/')
}
app.whenReady().then(() => {
createWindow()
})
app.on('did-finish-load', () => {
console.log('finished to load ');
})