aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Amine Mouafik <amine@mouafik.fr>2019-09-24 19:07:45 +0700
committerLibravatar Amine Mouafik <amine@mouafik.fr>2019-09-24 19:07:45 +0700
commitfb96056d0696038e78d7e8823bd1822e61b82304 (patch)
treed49c3bece67c94fb3a6fc138bdbd040b3e377503
parentMerge branch 'master' into feat/macos-signing (diff)
parent5.3.4-beta.2 (diff)
downloadferdium-app-fb96056d0696038e78d7e8823bd1822e61b82304.tar.gz
ferdium-app-fb96056d0696038e78d7e8823bd1822e61b82304.tar.zst
ferdium-app-fb96056d0696038e78d7e8823bd1822e61b82304.zip
Merge branch 'master' into feat/macos-signing
# Conflicts: # gulpfile.babel.js
-rw-r--r--gulpfile.babel.js2
-rw-r--r--package-lock.json2
-rw-r--r--package.json2
-rw-r--r--src/webview/darkmode/ignore.js3
-rw-r--r--src/webview/recipe.js30
5 files changed, 35 insertions, 4 deletions
diff --git a/gulpfile.babel.js b/gulpfile.babel.js
index 919ddca9f..142eb7b02 100644
--- a/gulpfile.babel.js
+++ b/gulpfile.babel.js
@@ -180,7 +180,7 @@ export function dictionaries(done) {
180 }); 180 });
181 181
182 _shell( 182 _shell(
183 `npm install --prefix ${path.join(__dirname, 'temp')} ${packages}`, 183 `npm install --prefix "${path.join(__dirname, 'temp')}" ${packages}`,
184 () => { 184 () => {
185 moveSync( 185 moveSync(
186 path.join(__dirname, 'temp', 'node_modules'), 186 path.join(__dirname, 'temp', 'node_modules'),
diff --git a/package-lock.json b/package-lock.json
index 4c70068cb..c4f36099b 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
1{ 1{
2 "name": "ferdi", 2 "name": "ferdi",
3 "version": "5.3.4-beta.1", 3 "version": "5.3.4-beta.2",
4 "lockfileVersion": 1, 4 "lockfileVersion": 1,
5 "requires": true, 5 "requires": true,
6 "dependencies": { 6 "dependencies": {
diff --git a/package.json b/package.json
index a3199a5cc..5fb2da096 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
2 "name": "ferdi", 2 "name": "ferdi",
3 "productName": "Ferdi", 3 "productName": "Ferdi",
4 "appId": "com.kytwb.ferdi", 4 "appId": "com.kytwb.ferdi",
5 "version": "5.3.4-beta.1", 5 "version": "5.3.4-beta.2",
6 "description": "Messaging app for WhatsApp, Slack, Telegram, HipChat, Hangouts and many many more.", 6 "description": "Messaging app for WhatsApp, Slack, Telegram, HipChat, Hangouts and many many more.",
7 "copyright": "kytwb", 7 "copyright": "kytwb",
8 "main": "index.js", 8 "main": "index.js",
diff --git a/src/webview/darkmode/ignore.js b/src/webview/darkmode/ignore.js
new file mode 100644
index 000000000..110df364f
--- /dev/null
+++ b/src/webview/darkmode/ignore.js
@@ -0,0 +1,3 @@
1export default [
2 'discordapp.com',
3];
diff --git a/src/webview/recipe.js b/src/webview/recipe.js
index fca00fde2..b30199f03 100644
--- a/src/webview/recipe.js
+++ b/src/webview/recipe.js
@@ -9,6 +9,8 @@ import {
9 disable as disableDarkMode, 9 disable as disableDarkMode,
10} from 'darkreader'; 10} from 'darkreader';
11 11
12import ignoreList from './darkmode/ignore';
13
12import RecipeWebview from './lib/RecipeWebview'; 14import RecipeWebview from './lib/RecipeWebview';
13 15
14import spellchecker, { switchDict, disable as disableSpellchecker, getSpellcheckerLocaleByFuzzyIdentifier } from './spellchecker'; 16import spellchecker, { switchDict, disable as disableSpellchecker, getSpellcheckerLocaleByFuzzyIdentifier } from './spellchecker';
@@ -123,7 +125,7 @@ class RecipeController {
123 125
124 if (darkModeExists) { 126 if (darkModeExists) {
125 injectDarkModeStyle(this.settings.service.recipe.path); 127 injectDarkModeStyle(this.settings.service.recipe.path);
126 } else { 128 } else if (!ignoreList.includes(window.location.host)) {
127 // Use darkreader instead 129 // Use darkreader instead
128 enableDarkMode(); 130 enableDarkMode();
129 } 131 }
@@ -194,6 +196,32 @@ new RecipeController();
194const originalWindowOpen = window.open; 196const originalWindowOpen = window.open;
195 197
196window.open = (url, frameName, features) => { 198window.open = (url, frameName, features) => {
199 if (!url && !frameName && !features) {
200 // The service hasn't yet supplied a URL (as used in Skype).
201 // Return a new dummy window object and wait for the service to change the properties
202 const newWindow = {
203 location: {
204 href: '',
205 },
206 };
207
208 const checkInterval = setInterval(() => {
209 // Has the service changed the URL yet?
210 if (newWindow.location.href !== '') {
211 // Open the new URL
212 window.open(newWindow.location.href);
213 clearInterval(checkInterval);
214 }
215 }, 0);
216
217 setTimeout(() => {
218 // Stop checking for location changes after 1 second
219 clearInterval(checkInterval);
220 }, 1000);
221
222 return newWindow;
223 }
224
197 // We need to differentiate if the link should be opened in a popup or in the systems default browser 225 // We need to differentiate if the link should be opened in a popup or in the systems default browser
198 if (!frameName && !features) { 226 if (!frameName && !features) {
199 return ipcRenderer.sendToHost('new-window', url); 227 return ipcRenderer.sendToHost('new-window', url);