From dec35a5b3d665ff169fadea6654b5c9c866aacb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Oliveira?= Date: Wed, 23 Aug 2023 23:34:46 +0100 Subject: [PATCH] Fix telegram deeplink by adding empty onload --- recipes/telegram/package.json | 2 +- recipes/telegram/webview.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/recipes/telegram/package.json b/recipes/telegram/package.json index 5f6a54364..95f06156d 100644 --- a/recipes/telegram/package.json +++ b/recipes/telegram/package.json @@ -1,7 +1,7 @@ { "id": "telegram", "name": "Telegram", - "version": "3.4.1", + "version": "3.4.2", "license": "MIT", "config": { "serviceURL": "https://web.telegram.org", diff --git a/recipes/telegram/webview.js b/recipes/telegram/webview.js index 5126e7d1e..ca12e4040 100644 --- a/recipes/telegram/webview.js +++ b/recipes/telegram/webview.js @@ -85,6 +85,9 @@ module.exports = (Ferdium, settings) => { Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); + // This is a hack to get the telegram web app to open links in Ferdium (otherwise it asks to deeplink and open with any tg:// protocol handler) + window.onload(() => {}); + // TODO: See how this can be moved into the main ferdium app and sent as an ipc message for opening with a new window or same Ferdium recipe's webview based on user's preferences document.addEventListener( 'click',