From 96e63dfe6dd6b79c1f8e657633aaff253b647e3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Oliveira?= <37463445+SpecialAro@users.noreply.github.com> Date: Thu, 24 Aug 2023 02:53:18 +0100 Subject: [PATCH] Fix telegram deeplink by adding empty onload (#407) --- 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',