From de7112198e005e13c837eaf743b2ee9d32837c27 Mon Sep 17 00:00:00 2001 From: André Oliveira <37463445+SpecialAro@users.noreply.github.com> Date: Mon, 5 Sep 2022 12:58:05 +0100 Subject: Revert "fix: add warning to whatsapp theming (#138)" (#171) This reverts commit 6b2bc506c212e88359f06107097ac4446bd5216f. --- recipes/whatsapp/package.json | 2 +- recipes/whatsapp/service.css | 17 +---------------- recipes/whatsapp/webview.js | 40 ---------------------------------------- 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 @@ { "id": "whatsapp", "name": "WhatsApp", - "version": "3.4.5", + "version": "3.4.6", "license": "MIT", "config": { "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 @@ /* fix for blank spaces regarding view width on screens larger than 1080p */ .app-wrapper-web ._1XkO3 { max-width: none !important; -} - -/* Warning for trying to change theme on whatsapp */ -.ferdium-theme-message { - padding-top: 15px; - color: red; - line-height: 20px; -} - -.ferdium-theme-title { - padding-top: 15px; - color: red; - line-height: 20px; - font-weight: bold; - text-align: center; -} +} \ No newline at end of file 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) { return obj && obj.__esModule ? obj : { default: obj }; } -function createElement(messageBody, idString) { - const messageText = document.createTextNode(messageBody); - const message = document.createElement("p"); - message?.setAttribute("id", idString); - message?.setAttribute("class", idString); - message?.appendChild(messageText); - - return message; -} - -function addThemeMessage() { - const idString = 'ferdium-theme-message'; - const idStringTitle = 'ferdium-theme-title'; - const elementExists = document.querySelectorAll(`.${idString}`)[0] || document.querySelectorAll(`.${idStringTitle}`)[0] ? true : false; - - if (!elementExists) { - const themePopupDiv = document.querySelectorAll("._2Nr6U")[0]; - - // Create Ferdium Warning title element - const messageTitleString = 'FERDIUM WARNING!'; - const messageTitleElement = createElement(messageTitleString, idStringTitle); - - // Create Ferdium Warning message element - const messageBody1 = 'To change your Whatsapp Theme, please use the native settings on Ferdium.'; - const messageBody2 = 'For that, right-click on the Whatsapp Service and click on Enable/Disable Dark mode.'; - const message1 = createElement(messageBody1, idString); - const message2 = createElement(messageBody2, idString); - - // Add messages to Whatsapp Window - themePopupDiv?.prepend(message2) - themePopupDiv?.prepend(message1) - themePopupDiv?.prepend(messageTitleElement) - - // Hide OK Button. - document.querySelectorAll("._20C5O")[1]?.setAttribute('style', 'display: none;'); - document.querySelectorAll("._2Nr6U > form")[0]?.setAttribute('style', 'display: none;'); - } -} - module.exports = Ferdium => { const getMessages = () => { let count = 0; @@ -87,7 +48,6 @@ module.exports = Ferdium => { const loopFunc = () => { getMessages(); getActiveDialogTitle(); - addThemeMessage(); }; window.addEventListener('beforeunload', async () => { -- cgit v1.2.3-54-g00ecf