2
2
mirror of https://github.com/Llewellynvdm/nativefier.git synced 2024-12-22 18:18:55 +00:00

Handle 'open-url' event: support "deep-linking" e.g. for mailto links (PR #1418, fix #1412)

This commit is contained in:
Sirisak Lueangsaksri 2022-05-30 20:40:13 +07:00 committed by GitHub
parent 59a4bb87f9
commit 0df5b8f617
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -228,6 +228,15 @@ app.on('will-finish-launching', () => {
log.debug('app.will-finish-launching'); log.debug('app.will-finish-launching');
}); });
app.on('open-url', (event, url) => {
log.debug('app.open-url', { event, url });
event.preventDefault();
if (mainWindow) {
mainWindow.webContents.send('open-url', url);
}
});
if (appArgs.widevine) { if (appArgs.widevine) {
// @ts-expect-error This event only appears on the widevine version of electron, which we'd see at runtime // @ts-expect-error This event only appears on the widevine version of electron, which we'd see at runtime
app.on('widevine-ready', (version: string, lastVersion: string) => { app.on('widevine-ready', (version: string, lastVersion: string) => {