aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar André Oliveira <37463445+SpecialAro@users.noreply.github.com>2022-09-05 12:58:05 +0100
committerLibravatar GitHub <noreply@github.com>2022-09-05 12:58:05 +0100
commitde7112198e005e13c837eaf743b2ee9d32837c27 (patch)
tree3b157893af72cd6912cb20d754502d4341963762
parentNew recipe: Odysee (#165) (diff)
downloadferdium-recipes-de7112198e005e13c837eaf743b2ee9d32837c27.tar.gz
ferdium-recipes-de7112198e005e13c837eaf743b2ee9d32837c27.tar.zst
ferdium-recipes-de7112198e005e13c837eaf743b2ee9d32837c27.zip
Revert "fix: add warning to whatsapp theming (#138)" (#171)
-rw-r--r--recipes/whatsapp/package.json2
-rw-r--r--recipes/whatsapp/service.css17
-rw-r--r--recipes/whatsapp/webview.js40
3 files changed, 2 insertions, 57 deletions
diff --git a/recipes/whatsapp/package.json b/recipes/whatsapp/package.json
index e2573dd..a708db4 100644
--- a/recipes/whatsapp/package.json
+++ b/recipes/whatsapp/package.json
@@ -1,7 +1,7 @@
1{ 1{
2 "id": "whatsapp", 2 "id": "whatsapp",
3 "name": "WhatsApp", 3 "name": "WhatsApp",
4 "version": "3.4.5", 4 "version": "3.4.6",
5 "license": "MIT", 5 "license": "MIT",
6 "config": { 6 "config": {
7 "serviceURL": "https://web.whatsapp.com", 7 "serviceURL": "https://web.whatsapp.com",
diff --git a/recipes/whatsapp/service.css b/recipes/whatsapp/service.css
index 667f618..0d4d5fc 100644
--- a/recipes/whatsapp/service.css
+++ b/recipes/whatsapp/service.css
@@ -15,19 +15,4 @@
15/* fix for blank spaces regarding view width on screens larger than 1080p */ 15/* fix for blank spaces regarding view width on screens larger than 1080p */
16.app-wrapper-web ._1XkO3 { 16.app-wrapper-web ._1XkO3 {
17 max-width: none !important; 17 max-width: none !important;
18} 18} \ No newline at end of file
19
20/* Warning for trying to change theme on whatsapp */
21.ferdium-theme-message {
22 padding-top: 15px;
23 color: red;
24 line-height: 20px;
25}
26
27.ferdium-theme-title {
28 padding-top: 15px;
29 color: red;
30 line-height: 20px;
31 font-weight: bold;
32 text-align: center;
33}
diff --git a/recipes/whatsapp/webview.js b/recipes/whatsapp/webview.js
index d0b0cd8..77c4ebb 100644
--- a/recipes/whatsapp/webview.js
+++ b/recipes/whatsapp/webview.js
@@ -4,45 +4,6 @@ function _interopRequireDefault(obj) {
4 return obj && obj.__esModule ? obj : { default: obj }; 4 return obj && obj.__esModule ? obj : { default: obj };
5} 5}
6 6
7function createElement(messageBody, idString) {
8 const messageText = document.createTextNode(messageBody);
9 const message = document.createElement("p");
10 message?.setAttribute("id", idString);
11 message?.setAttribute("class", idString);
12 message?.appendChild(messageText);
13
14 return message;
15}
16
17function addThemeMessage() {
18 const idString = 'ferdium-theme-message';
19 const idStringTitle = 'ferdium-theme-title';
20 const elementExists = document.querySelectorAll(`.${idString}`)[0] || document.querySelectorAll(`.${idStringTitle}`)[0] ? true : false;
21
22 if (!elementExists) {
23 const themePopupDiv = document.querySelectorAll("._2Nr6U")[0];
24
25 // Create Ferdium Warning title element
26 const messageTitleString = 'FERDIUM WARNING!';
27 const messageTitleElement = createElement(messageTitleString, idStringTitle);
28
29 // Create Ferdium Warning message element
30 const messageBody1 = 'To change your Whatsapp Theme, please use the native settings on Ferdium.';
31 const messageBody2 = 'For that, right-click on the Whatsapp Service and click on Enable/Disable Dark mode.';
32 const message1 = createElement(messageBody1, idString);
33 const message2 = createElement(messageBody2, idString);
34
35 // Add messages to Whatsapp Window
36 themePopupDiv?.prepend(message2)
37 themePopupDiv?.prepend(message1)
38 themePopupDiv?.prepend(messageTitleElement)
39
40 // Hide OK Button.
41 document.querySelectorAll("._20C5O")[1]?.setAttribute('style', 'display: none;');
42 document.querySelectorAll("._2Nr6U > form")[0]?.setAttribute('style', 'display: none;');
43 }
44}
45
46module.exports = Ferdium => { 7module.exports = Ferdium => {
47 const getMessages = () => { 8 const getMessages = () => {
48 let count = 0; 9 let count = 0;
@@ -87,7 +48,6 @@ module.exports = Ferdium => {
87 const loopFunc = () => { 48 const loopFunc = () => {
88 getMessages(); 49 getMessages();
89 getActiveDialogTitle(); 50 getActiveDialogTitle();
90 addThemeMessage();
91 }; 51 };
92 52
93 window.addEventListener('beforeunload', async () => { 53 window.addEventListener('beforeunload', async () => {