aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/slack
diff options
context:
space:
mode:
authorLibravatar Vijay A <vraravam@users.noreply.github.com>2022-05-16 19:29:14 -0500
committerLibravatar Vijay A <vraravam@users.noreply.github.com>2022-05-16 19:29:14 -0500
commit50cfe923866aed9e4ef14fdeca91102bf2e0f2aa (patch)
tree91fc4cacfa28153fd8abc61f92618c8cafddf845 /recipes/slack
parentUse a click-handler for slack to capture all click events and open in the sam... (diff)
downloadferdium-recipes-50cfe923866aed9e4ef14fdeca91102bf2e0f2aa.tar.gz
ferdium-recipes-50cfe923866aed9e4ef14fdeca91102bf2e0f2aa.tar.zst
ferdium-recipes-50cfe923866aed9e4ef14fdeca91102bf2e0f2aa.zip
Partially revert ddeaca3d6776d8 (remove clickHandler for slack since it didn't fix #145
Diffstat (limited to 'recipes/slack')
-rw-r--r--recipes/slack/package.json2
-rw-r--r--recipes/slack/webview.js14
2 files changed, 1 insertions, 15 deletions
diff --git a/recipes/slack/package.json b/recipes/slack/package.json
index 6d18dac..9105f31 100644
--- a/recipes/slack/package.json
+++ b/recipes/slack/package.json
@@ -1,7 +1,7 @@
1{ 1{
2 "id": "slack", 2 "id": "slack",
3 "name": "Slack", 3 "name": "Slack",
4 "version": "1.4.1", 4 "version": "1.4.2",
5 "license": "MIT", 5 "license": "MIT",
6 "config": { 6 "config": {
7 "serviceURL": "https://{teamId}.slack.com", 7 "serviceURL": "https://{teamId}.slack.com",
diff --git a/recipes/slack/webview.js b/recipes/slack/webview.js
index 652b586..b3722f0 100644
--- a/recipes/slack/webview.js
+++ b/recipes/slack/webview.js
@@ -75,18 +75,4 @@ module.exports = Ferdium => {
75 }, 4000); 75 }, 4000);
76 76
77 Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); 77 Ferdium.injectCSS(_path.default.join(__dirname, 'service.css'));
78
79 // 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
80 document.addEventListener('click', event => {
81 const link = event.target.closest('a[href^="http"]');
82 const button = event.target.closest('button[title^="http"]');
83
84 if (link || button) {
85 const url = link ? link.getAttribute('href') : button.getAttribute('title');
86
87 event.preventDefault();
88 event.stopPropagation();
89 window.location.href = url;
90 }
91 }, true);
92}; 78};