LukasLen / Privacy-Extension-For-WhatsApp-Web

Hides your WhatsApp messages until you hover over them.
https://pfwa.lukaslen.com
MIT License
118 stars 44 forks source link

Update to support WhatsApp Version 2.3000.xx #66

Closed aryomuzakki closed 2 months ago

aryomuzakki commented 3 months ago

Update the selectors to support WhatsApp Version 2.3000.1012572464

Tested in my local development environment: Browser : Brave v1.64.113 with Chromium v123.0.6312.86 OS: Windows 10 22H2 64Bit Build 19045.4170

This should close issue #56 #57 #60 #62 #64 and #65 And after rough checking, this should blur more compared to pull request #61 and #63

Changes :

I leave the former selectors on purpose for version compatibility.

Dear Owner, please review soon @LukasLen , Thank You

Allow me to mention people who might need this @Tgentil, @mclorand, @roniekas, @nikhilnk2206, @cruzy67, @Ahmed-Soli, @techsamy, @Usama171, @amithm7, @aritrakrbasu, @UsmanAhmadSaeed, @hndko, @Spacetaxfiling, @GodAnt12, @asim-hawklogix, @vvarl0cks, @satishgadhave, @MvrckTheBald, @ticmaidev, @LivreAcessoPro, @URODESUKA, @fabianodellano, @TejasMishr

Tgentil commented 2 months ago

I tested the update in this PR and found it to be solid. It successfully resolves the major issue of having to repeatedly clear the cache. It also seems to address all the issues highlighted in PR #61 effectively. Additionally, the code appears to be cleaner and better commented than in the previous PR, making it a robust solution for the extension’s functionality with WhatsApp's latest version.

LivreAcessoPro commented 2 months ago

image It not works for Firefox ESR.

TejasMishr commented 2 months ago

@aryomuzakki Please Check it For Firefox.

Tgentil commented 2 months ago

@TejasMishr and @LivreAcessoPro

I've tested PR #66 and can confirm it works perfectly on Firefox. For those interested, to use this updated version on Firefox, you'll need to download the repository from LukasLen/Privacy-Extension-For-WhatsApp-Web. Install GitHub CLI and run gh pr checkout 66 to fetch the PR.

Due to a known issue with service workers in Firefox and the Manifest V3 update, some modifications are necessary. You can read more about this issue in these links: background.service_worker is currently disabled, W3C WebExtensions, and Manifest v3 background scripts/service worker on Firefox.

In brief, remove the chrome manifest (manifest.json) and rename manifest_firefox.json to manifest.json. This workaround should make the extension work. If you're using Firefox version lower than 120, you might need to tweak the background script setting in the manifest changing it:

From:

  "background": {
    "scripts": ["background.js"],
    "service_worker": "background.js"
  },

To:

"background": {
    "scripts": ["background.js"]
},

Then you import the manifest in Firefox through about:debugging#/runtime/this-firefox.

temporary extension

Here's a screenshot showing the extension working in Firefox:

extension working fine

Hope this helps, and let's encourage @LukasLen to merge PR #66 soon for wider availability.

aryomuzakki commented 2 months ago

Sorry I haven't got the chance for testing in firefox. Thank you @Tgentil for testing and checking the code, also thanks for your helpful guide.

guisithos commented 2 months ago

@TejasMishr and @LivreAcessoPro

I've tested PR #66 and can confirm it works perfectly on Firefox. For those interested, to use this updated version on Firefox, you'll need to download the repository from LukasLen/Privacy-Extension-For-WhatsApp-Web. Install GitHub CLI and run gh pr checkout 66 to fetch the PR.

Firefox 124.0.2, working flawless doing as described by @Tgentil

LukasLen commented 2 months ago

I just tested this PR and moving forward with this change for version 3.2.0. Thanks for contributing! This essentially resolves #56, #57, #60, #62, #64, #65. I am also closing #61 and #63.

LivreAcessoPro commented 2 months ago

Houve um erro ao instalar a extensão temporária. Detalhes do erro

Add-on contact@lukaslen.com is not compatible with application version. add-on minVersion: 121.0.

Minversion changed to "115".

Still not working on Firefox ESR 115.9.1esr (64-bits)

Tgentil commented 2 months ago

Houve um erro ao instalar a extensão temporária. Detalhes do erro

Add-on contact@lukaslen.com is not compatible with application version. add-on minVersion: 121.0.

Minversion changed to "115".

Still not working on Firefox ESR 115.9.1esr (64-bits)

@LivreAcessoPro, please download the update version 3.2.0 on the Firefox Add-ons Store: Updated Version. it should fix your problem.

mclorand commented 2 months ago

I just tested this PR and moving forward with this change for version 3.2.0. Thanks for contributing! This essentially resolves #56, #57, #60, #62, #64, #65. I am also closing #61 and #63.

Plugin works now, thanks

ticmaisdev commented 2 months ago

@LivreAcessoPro have you tried clicking on the extension icon? firefox won't enable the extension, unless you'll click on the icon

Tgentil commented 2 months ago

@LivreAcessoPro, it seems like the issue might be due to your Firefox ESR version (115.9.1esr) not supporting service workers of the new Manifest V3, which is needed for the extension to function properly. Firefox added support for Manifest V3 service workers starting from version 120. Upgrading to a newer version of Firefox might resolve the compatibility issue. You can read more about these limitations and their solutions in the Firefox documentation and community discussions.

LivreAcessoPro commented 2 months ago

@

@LivreAcessoPro, it seems like the issue might be due to your Firefox ESR version (115.9.1esr) not supporting service workers of the new Manifest V3, which is needed for the extension to function properly. Firefox added support for Manifest V3 service workers starting from version 120. Upgrading to a newer version of Firefox might resolve the compatibility issue. You can read more about these limitations and their solutions in the Firefox documentation and community discussions.

A managed to make it work, partially, Firefox ESR version (115.9.1esr). I removed the worker part, and downgraded the version number. The blur taken action on the message panel, but not on the left panel.

aryomuzakki commented 2 months ago

@LivreAcessoPro , yeah, I remove service_worker option, then change or remove strict_min_version option too. I also use this step, sorry I forgot if this required or not.

  1. Enter about:config in your address bar, and continue to the list of preferences.
  2. Find the xpinstall.signatures.required preference and set it to false.

source https://support.mozilla.org/en-US/kb/install-system-add-ons-firefox-enterprise

This make extension work in my local, Firefox ESR v115.9.1esr WA v2.3000.1012868116 Windows 10 22H2 64Bit Build 19045.4170

image

All the blurs are working

image

can you provide a screenshot for which part are not bluring?

LivreAcessoPro commented 2 months ago

Done: Captura de tela de 2024-04-19 17-10-02

LivreAcessoPro commented 2 months ago
{
  "manifest_version": 3,
  "default_locale": "en",
  "name": "__MSG_extensionName__",
  "description": "__MSG_extensionDescription__",
  "version": "3.2.0",
  "action": {
    "default_title": "__MSG_extensionName__",
    "default_popup": "popup/popup.html",
    "default_icon": {
      "16": "images/icon16.png",
      "24": "images/icon24.png",
      "32": "images/icon32.png"
    }
  },
  "icons": {
    "16": "images/icon16.png",
    "32": "images/icon32.png",
    "48": "images/icon48.png",
    "128": "images/icon128.png"
  },
  "permissions": [
    "storage"
  ],
  "host_permissions": [
    "https://web.whatsapp.com/*"
  ],
  "background": {
    "scripts": [
      "background.js"
    ]
  },
  "browser_specific_settings": {
    "gecko": {
      "id": "contact@lukaslen.com",
      "strict_min_version": "115.0"
    }
  },
  "content_scripts": [
    {
      "matches": [
        "https://web.whatsapp.com/*"
      ],
      "js": [
        "scripts/contentScript.js"
      ]
    }
  ],
  "web_accessible_resources": [
    {
      "resources": [
        "images/statusOn.png",
        "images/statusOff.png",
        "css/messages.css",
        "css/messagesPreview.css",
        "css/mediaPreview.css",
        "css/mediaGallery.css",
        "css/textInput.css",
        "css/profilePic.css",
        "css/name.css",
        "css/noDelay.css",
        "css/unblurActive.css"
      ],
      "matches": [
        "https://web.whatsapp.com/*"
      ]
    }
  ],
  "commands": {
    "toggle": {
      "suggested_key": {
        "default": "Alt+X"
      },
      "description": "Toggle On/Off"
    }
  }
}
LivreAcessoPro commented 2 months ago

Done: Captura de tela de 2024-04-19 17-10-02

After reloading Firefox ESR, it's working. Thanks, @aryomuzakki