aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/discord
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/discord')
-rw-r--r--recipes/discord/package.json2
-rw-r--r--recipes/discord/webview.js12
2 files changed, 9 insertions, 5 deletions
diff --git a/recipes/discord/package.json b/recipes/discord/package.json
index 0deb4a9..e0c35aa 100644
--- a/recipes/discord/package.json
+++ b/recipes/discord/package.json
@@ -1,7 +1,7 @@
1{ 1{
2 "id": "discord", 2 "id": "discord",
3 "name": "Discord", 3 "name": "Discord",
4 "version": "1.7.2", 4 "version": "1.7.3",
5 "license": "MIT", 5 "license": "MIT",
6 "config": { 6 "config": {
7 "serviceURL": "https://discordapp.com/login", 7 "serviceURL": "https://discordapp.com/login",
diff --git a/recipes/discord/webview.js b/recipes/discord/webview.js
index 7612d83..cadafb1 100644
--- a/recipes/discord/webview.js
+++ b/recipes/discord/webview.js
@@ -4,7 +4,8 @@ function _interopRequireDefault(obj) {
4 return obj && obj.__esModule ? obj : { default: obj }; 4 return obj && obj.__esModule ? obj : { default: obj };
5} 5}
6 6
7module.exports = Ferdium => { 7module.exports = (Ferdium, settings) => {
8 console.log('settings', settings);
8 const getMessages = () => { 9 const getMessages = () => {
9 let directCount = 0; 10 let directCount = 0;
10 const directCountPerServer = document.querySelectorAll( 11 const directCountPerServer = document.querySelectorAll(
@@ -34,9 +35,12 @@ module.exports = Ferdium => {
34 if (link || button) { 35 if (link || button) {
35 const url = link ? link.getAttribute('href') : button.getAttribute('title'); 36 const url = link ? link.getAttribute('href') : button.getAttribute('title');
36 37
37 if (url.includes('views/imgpsh_fullsize_anim')) { 38 event.preventDefault();
38 event.preventDefault(); 39 event.stopPropagation();
39 event.stopPropagation(); 40
41 if (settings.trapLinkClicks === true) {
42 window.location.href = url;
43 } else {
40 Ferdium.openNewWindow(url); 44 Ferdium.openNewWindow(url);
41 } 45 }
42 } 46 }