Skip to content
This repository was archived by the owner on Sep 29, 2023. It is now read-only.
This repository was archived by the owner on Sep 29, 2023. It is now read-only.

Whatsapp Web reports it needs chrome 60+ even though I have chromium 86 #1112

Closed

Description

@Itai-Nelken

Homework

Bug description

my WhatsappWeb nativefier webapp is complaining that the chrome version isn't new enough even though I have chromium 87.

Steps to reproduce

Give your full nativefier command and its logs, with the --verbose flag, on a public site:

pi@Twisterpi4-ultra-4gb:~/Documents $ nativefier --arch=armv7l --tray --verbose https://web.whatsapp.com
Running in verbose mode! This will produce a mountain of logs and is recommended only for troubleshooting or if you like Shakespeare.

Performing async options post-processing.
Inferring user agent for electron 11.1.1 / linux
Grabbing electron<->chrome versions file from https://atom.io/download/atom-shell/index.json
Inferring icon for https://web.whatsapp.com/ on linux
Inferring icon from store for https://web.whatsapp.com/ on linux
Allowed icon formats when building for linux: [ '.png', '.ico' ]
Inferring name for https://web.whatsapp.com/
Got 249 icons from gitcloud
Max icon match score: 1
Downloading https://nativefier.github.io/nativefier-icons/files/whatsapp.png
Fetched 3.5 kb page at https://web.whatsapp.com/
Inferred title: WhatsApp Web
Sanitized filename for WhatsApp Web : WhatsAppWeb
Got an icon from the page.
Writing 159.2 kb icon to /tmp/nativefier-17-54-2-iconinfer--2434-IBXu9tksPljI/icon.png
Associated electron v11.1.1 to chrome v87.0.4280.88
Given chrome 87.0.4280.88 on linux, using user agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36

Preparing Electron app...
Copying electron app from /usr/lib/node_modules/nativefier/app to /tmp/nativefier-17-54-2-app--2434-2YfMkOSuXbCo
Writing app config to /tmp/nativefier-17-54-2-app--2434-2YfMkOSuXbCo/nativefier.json
No files to inject, skipping copy.
Updating /tmp/nativefier-17-54-2-app--2434-2YfMkOSuXbCo/package.json 'name' field to whatsappweb-nativefier-d40211

Converting icons...
Building for Linux and icon is already a .png, no conversion needed
Copying icons if necessary
Copying icon /tmp/nativefier-17-54-2-iconinfer--2434-IBXu9tksPljI/icon.png to /tmp/nativefier-17-54-2-app--2434-2YfMkOSuXbCo/icon.png

Packaging... This will take a few seconds, maybe minutes if the requested Electron isn't cached yet...
  electron-packager Electron Packager 15.2.0
  electron-packager Node v15.8.0
  electron-packager Host Operating system: linux 5.10.11-v7l+ (arm) +0ms
  electron-packager Packager Options: {"arch":"armv7l","asar":false,"darwinDarkModeSupport":false,"dir":"/tmp/nativefier-17-54-2-app--2434-2YfMkOSuXbCo","electronVersion":"11.1.1","icon":"/tmp/nativefier-17-54-2-iconinfer--2434-IBXu9tksPljI/icon.png","name":"WhatsAppWeb","out":"/home/pi/Documents","overwrite":true,"platform":"linux","targetUrl":"https://web.whatsapp.com/","tmpdir":false,"win32metadata":{}} +2ms
  electron-packager Target Platforms: linux +1ms
  electron-packager Target Architectures: armv7l +1ms
  electron-packager Inferring appVersion from version in /tmp/nativefier-17-54-2-app--2434-2YfMkOSuXbCo/package.json +0ms
  electron-packager Application name: WhatsAppWeb +25ms
  electron-packager Target Electron version: 11.1.1 +1ms
  electron-packager Ignored path regular expressions: [
  '/package-lock\\.json$',
  '/yarn\\.lock$',
  '/\\.git($|/)',
  '/node_modules/\\.bin($|/)',
  '\\.o(bj)?$',
  '/tmp/electron-packager'
] +0ms
  electron-packager Downloading Electron with options {"platform":"linux","arch":"armv7l","version":"11.1.1","artifactName":"electron"} +0ms
Packaging app for platform linux armv7l using electron v11.1.1
  electron-packager Creating /home/pi/Documents/linux-armv7l-template +12ms
  electron-packager Extracting /home/pi/.cache/electron/af55cf85e08a7252cdf4740b3b9843bcd6ee0d88d78fc42ee0de0a928079a3b5/electron-v11.1.1-linux-armv7l.zip to /home/pi/Documents/linux-armv7l-template +2ms
  electron-packager Initializing app in /home/pi/Documents/WhatsAppWeb-linux-armv7l from /home/pi/Documents/linux-armv7l-template template +0ms
  electron-packager Ignored paths based on the out param: [
  '/home/pi/Documents/WhatsAppWeb-darwin-x64',
  '/home/pi/Documents/WhatsAppWeb-darwin-arm64',
  '/home/pi/Documents/WhatsAppWeb-linux-ia32',
  '/home/pi/Documents/WhatsAppWeb-linux-x64',
  '/home/pi/Documents/WhatsAppWeb-linux-armv7l',
  '/home/pi/Documents/WhatsAppWeb-linux-arm64',
  '/home/pi/Documents/WhatsAppWeb-linux-mips64el',
  '/home/pi/Documents/WhatsAppWeb-mas-x64',
  '/home/pi/Documents/WhatsAppWeb-mas-arm64',
  '/home/pi/Documents/WhatsAppWeb-win32-ia32',
  '/home/pi/Documents/WhatsAppWeb-win32-x64',
  '/home/pi/Documents/WhatsAppWeb-win32-arm64'
] +5s
  electron-packager Renaming electron to WhatsAppWeb in /home/pi/Documents/WhatsAppWeb-linux-armv7l +154ms

Finalizing build...
App built to /home/pi/Documents/WhatsAppWeb-linux-armv7l , move it wherever it makes sense for you and run the contained executable file (prefixing with ./ if necessary)
Menu/desktop shortcuts are up to you, because Nativefier cannot know where you're going to move the app. Search for "linux .desktop file" for help, or see https://wiki.archlinux.org/index.php/Desktop_entries
pi@Twisterpi4-ultra-4gb:~/Documents $ 

Expected behavior

I expected the page with the QR code asking you to sign in to appear.

Actual behavior

it opened a page asking me to use chrome 60+

Debug info
It did work untill a few days ago.
I don't know if it helps, but before updating nativefier I got this when packaging whatsapp web (same error when starting the app though):

Unable to infer chrome version for user agent, using 87.0.4280.67

I installed/updated nativefier like this:

pi@Twisterpi4-ultra-4gb:~ $ sudo npm install -g nativefier --arch=armv7l
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142

added 2 packages, removed 32 packages, changed 269 packages, and audited 272 packages in 1m

17 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
npm notice 
npm notice New patch version of npm available! 7.5.1 -> 7.5.3
npm notice Changelog: https://github.com/npm/cli/releases/tag/v7.5.3
npm notice Run npm install -g [email protected] to update!
npm notice 
pi@Twisterpi4-ultra-4gb:~ $ 

not using sudo caused it to fail because it didn't have the right permissions.
I did try using the --honest option but I got the same result.

The error:
flameshot_screenshot
My chromium version:
flameshot_screenshot
whatsapp web does work in chromium:
flameshot_screenshot

Context

  • Nativefier: 42.2.1
  • Node.js: v15.8.0
  • Npm: 7.5.1
  • OS: TwisterOS 1.9.9 (based on RPiOS 32bit) armhf running on a RaspberryPi 4b 4gb.
  • Is it a regression? I don't know.

Activity

  1. anihm136 commented on Feb 10, 2021

    @anihm136

    I have the same issue, running on Arch Linux (kernel 5.10.14-arch1-1), with whatsapp-nativefier installed from the AUR

  2. robocopkaka commented on Feb 10, 2021

    @robocopkaka

    Same issue. Running on Ubuntu 20.04

  3. Itai-Nelken commented on Feb 15, 2021

    @Itai-Nelken
    Author

    I made a whatsapp web nativefier webapp on MacOS (intel) and it works perfectly fine.

  4. Itai-Nelken commented on Feb 16, 2021

    @Itai-Nelken
    Author

    I packaged a linux armv7l nativefier whatsapp web webapp on my mac and it works perfectly fine!
    Maybe its something to do with the user agent? I did try using nativefiers option to use a different user agent, but it didn't work.

  5. robocopkaka commented on Feb 16, 2021

    @robocopkaka

    I also tried using different user agents but kept running into the same issue

  6. Itai-Nelken commented on Feb 16, 2021

    @Itai-Nelken
    Author

    I think the option to use a different user agent is broken.

  7. nilava commented on Feb 25, 2021

    @nilava

    i used programatic API to build and passed

     userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_1) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Safari/605.1.15', // will infer a default for your current system
      honest: false,
    

    Also modified constants.js inside nativefier to use

    exports.DEFAULT_ELECTRON_VERSION = '11.3.0';
    exports.DEFAULT_CHROME_VERSION = '87.0.4280.141';
    

    which made it work

  8. Itai-Nelken commented on Feb 26, 2021

    @Itai-Nelken
    Author

    @nilava can you post the steps you followed for people like me who don't understand electron/javascript/typescript whatever etc. please?

  9. K4R7IK commented on Mar 9, 2021

    @K4R7IK

    @nilava Can you let us know where to edit the files as i can't figure out where constants.js is located.

  10. TheCleric commented on Mar 9, 2021

    @TheCleric
    Collaborator

    I've gotten this to work on OS X with the following caveat:

    I was able to run it via nativefier --verbose https://web.whatsapp.com --user-agent "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_1) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Safari/605.1.15"

    HOWEVER: Since I originally tried running it without the user agent, it looks like WhatsApp will cache what it thinks your user agent was even between app rebuilds, so I had to run the following commands from a command line to start fresh with the app:

    rm -rf ~/Library/Preferences/com.electron.whatsapp*
    rm -rf ~/Library/Application\ Support/whatsapp*
  11. Itai-Nelken commented on Mar 9, 2021

    @Itai-Nelken
    Author

    I've gotten this to work on OS X with the following caveat:

    I was able to run it via nativefier --verbose https://web.whatsapp.com --user-agent "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_1) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Safari/605.1.15"

    HOWEVER: Since I originally tried running it without the user agent, it looks like WhatsApp will cache what it thinks your user agent was even between app rebuilds, so I had to run the following commands from a command line to start fresh with the app:

    rm -rf ~/Library/Preferences/com.electron.whatsapp*
    rm -rf ~/Library/Application\ Support/whatsapp*

    I can confirm that works for me on MacOS 11.2.2 and on the latest TwisterOS (RPiOS) after removing ~/.config/whatsappweb*.

  12. Itai-Nelken commented on Mar 9, 2021

    @Itai-Nelken
    Author

    UPDATE: I have to delete ~/.config/whatsappweb-nativefier*/Service\ Worker each time I want to run the app, also clicking the 'update' button on the banner that appears from time to time causes it to say it needs a newer chrome version (I'm using a safari user agent).

  13. TheCleric commented on Mar 9, 2021

    @TheCleric
    Collaborator

    Same is true for me as well (~/Library/Application\ Support/whatsapp-web-nativefier*/Service\ Worker/Database) @Itai-Nelken .

    I'm trying to look into it and the best I can surmise is this: It loads the first time, but their javascript has some custom Electron detection, and saves a note for itself to block on the next reload. I have figured out how to prevent this from happening, but will need to get @ronjouch 's appetite for adding yet another cli flag.

    It boils down to this: if we clear the serviceworker's storage every time the app loads, this issue goes away and still keeps you logged in (await session.clearStorageData({ storages: ['serviceworkers'] });) but I don't think we want to do that universally. @ronjouch what do you think?

    Right now you can add --clear-cache to the app to have it clear EVERYTHING, which prevents the detection as well, but that means you have to log back in every time.

    Also as a side note, is there a reason you prefer doing a nativefier version of the app over their desktop app @Itai-Nelken (which appears to also be based on Electron)?

  14. Itai-Nelken commented on Mar 9, 2021

    @Itai-Nelken
    Author

    Also as a side note, is there a reason you prefer doing a nativefier version of the app over their desktop app @Itai-Nelken (which appears to also be based on Electron)?

    @TheCleric the official desktop app isn't available for ARM.

  15. 18 remaining items

  16. Itai-Nelken commented on Apr 29, 2021

    @Itai-Nelken
    Author

    Sorry, accidentally pressed the close button.

  17. TheCleric commented on Apr 29, 2021

    @TheCleric
    Collaborator

    @TheCleric yes, but I think something about clearing the service worker's cache in websites that don't work should be added to the docs.

    @Itai-Nelken I'll see where we could add that at.

  18. TheCleric commented on Apr 30, 2021

    @TheCleric
    Collaborator

    @Itai-Nelken we've added a new troubleshooting section to our README that covers this and other common use cases. 😊

  19. unpinned this issue on Apr 30, 2021
  20. deciacco commented on Aug 5, 2021

    @deciacco
    Contributor

    I think this may be broken... i've been using the injected code per the readme as well as the "-u" options for some time and it stopped working today.

    tried different user strings, even the keywords, etc. im on the latest nativefier on latest windows.

    should I open a new issue??

  21. Itai-Nelken commented on Aug 5, 2021

    @Itai-Nelken
    Author

    Same thing happened to me. After restarting the app a few times it started working again.

  22. deciacco commented on Aug 6, 2021

    @deciacco
    Contributor

    Same thing happened to me. After restarting the app a few times it started working again.

    Not doing it for me... tried restarting several times, deleted the app folder in appdata, that allows the app to reset and register with what's app qr code, but after that, if I close and reopen it pops up with the dreadful chrome v. 60 message. They are such a pain... I shouldn't use Whatsapp anyway, but I refuse to install their app. Unfortunately, I need it to keep in touch with family overseas...

  23. TheCleric commented on Aug 6, 2021

    @TheCleric
    Collaborator

    Same thing happened to me. After restarting the app a few times it started working again.

    Not doing it for me... tried restarting several times, deleted the app folder in appdata, that allows the app to reset and register with what's app qr code, but after that, if I close and reopen it pops up with the dreadful chrome v. 60 message. They are such a pain... I shouldn't use Whatsapp anyway, but I refuse to install their app. Unfortunately, I need it to keep in touch with family overseas...

    Is this also being built with the service worker fix outlined above?

  24. deciacco commented on Aug 6, 2021

    @deciacco
    Contributor

    yeah... service worker fix injected as per the readme and the -u option set as well. tried all three and doesn't seem to work... it seems odd, but all of a sudden it stopped working.... rebuilt with latest nativefier, etc.. but no go 🤔

    I used this code to make sure it was being called:

    if ('serviceWorker' in navigator) {
        caches.keys().then(function (cacheNames) {
            cacheNames.forEach(function (cacheName) {
                caches.delete(cacheName);
    			console.log("deleting " + cacheName);
            });
        });
    }
    

    This is the output in the console:

    image

    OS Name: Microsoft Windows 10 Home
    OS Version: 10.0.19043 N/A Build 19043
    Nativefier: 45.0.0 w/ Electron v13.1.7

  25. kjmoore commented on Oct 25, 2021

    @kjmoore

    This also stopped working for me, but unregistering the service worker did work...

    Built with:
    nativefier https://web.whatsapp.com --user-agent "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_1) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Safari/605.1.15" -n WhatsApp --inject unregister-worker.js --single-instance

    unregister-worker.js:

    navigator.serviceWorker.getRegistrations().then(
      function(registrations) {
        for(let registration of registrations) {
          registration.unregister();
        }
        if (registrations.length > 0) {
          location.reload();
        }
      }
    );
    
  26. Grunkhead commented on Nov 24, 2021

    @Grunkhead

    @kjmoore I can confirm, that works for me too. But the with the option --single-instance, the build does crash. So I removed that one.

  27. Grunkhead commented on Nov 24, 2021

    @Grunkhead

    nativefier --verbose "https://web.whatsapp.com/" --user-agent "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_1) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Safari/605.1.15" --name "WhatsApp" --icon "whatsapp.icns" --inject unregister-worker.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions