aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/telegram/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/telegram/index.js')
-rw-r--r--recipes/telegram/index.js25
1 files changed, 24 insertions, 1 deletions
diff --git a/recipes/telegram/index.js b/recipes/telegram/index.js
index dd41f72..ac618ae 100644
--- a/recipes/telegram/index.js
+++ b/recipes/telegram/index.js
@@ -1 +1,24 @@
1module.exports = Ferdium => Ferdium; 1function instrumenEnvironment(webview) {
2 webview.executeJavaScript(`
3 (function() {
4 if(window.electron) {
5 return;
6 }
7
8 window.electron = { };
9 })();
10 `);
11}
12module.exports = Ferdium =>
13 class Telegram extends Ferdium {
14 // https://www.electronjs.org/docs/latest/api/webview-tag/#dom-events
15 get events() {
16 return {
17 'load-commit': 'loadCommit',
18 };
19 }
20
21 loadCommit(event) {
22 instrumenEnvironment(event.target);
23 }
24 };