Repository navigation
Whatsapp Web reports it needs chrome 60+ even though I have chromium 86 #1112
Description
Homework
- I looked at
nativefier --helpand https://github.com/nativefier/nativefier/blob/master/docs/api.md - I searched existing issues, open & closed. Yes, my bug is new.
- I'm using the latest version available at https://github.com/nativefier/nativefier/releases
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:

My chromium version:

whatsapp web does work in chromium:

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
anihm136 commentedon Feb 10, 2021
I have the same issue, running on Arch Linux (kernel 5.10.14-arch1-1), with
whatsapp-nativefierinstalled from the AURrobocopkaka commentedon Feb 10, 2021
Same issue. Running on Ubuntu 20.04
Itai-Nelken commentedon Feb 15, 2021
I made a whatsapp web nativefier webapp on MacOS (intel) and it works perfectly fine.
Itai-Nelken commentedon Feb 16, 2021
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.
robocopkaka commentedon Feb 16, 2021
I also tried using different user agents but kept running into the same issue
Itai-Nelken commentedon Feb 16, 2021
I think the option to use a different user agent is broken.
nilava commentedon Feb 25, 2021
i used programatic API to build and passed
Also modified constants.js inside nativefier to use
which made it work
Itai-Nelken commentedon Feb 26, 2021
@nilava can you post the steps you followed for people like me who don't understand electron/javascript/typescript whatever etc. please?
K4R7IK commentedon Mar 9, 2021
@nilava Can you let us know where to edit the files as i can't figure out where constants.js is located.
TheCleric commentedon Mar 9, 2021
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:
Itai-Nelken commentedon Mar 9, 2021
I can confirm that works for me on MacOS 11.2.2 and on the latest TwisterOS (RPiOS) after removing
~/.config/whatsappweb*.Itai-Nelken commentedon Mar 9, 2021
UPDATE: I have to delete
~/.config/whatsappweb-nativefier*/Service\ Workereach 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).TheCleric commentedon Mar 9, 2021
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-cacheto 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)?
Itai-Nelken commentedon Mar 9, 2021
@TheCleric the official desktop app isn't available for ARM.
18 remaining items
Itai-Nelken commentedon Apr 29, 2021
Sorry, accidentally pressed the close button.
TheCleric commentedon Apr 29, 2021
@Itai-Nelken I'll see where we could add that at.
README: add troubleshooting section for common issues (#1169)
TheCleric commentedon Apr 30, 2021
@Itai-Nelken we've added a new troubleshooting section to our README that covers this and other common use cases. 😊
deciacco commentedon Aug 5, 2021
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??
Itai-Nelken commentedon Aug 5, 2021
Same thing happened to me. After restarting the app a few times it started working again.
deciacco commentedon Aug 6, 2021
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...
TheCleric commentedon Aug 6, 2021
Is this also being built with the service worker fix outlined above?
deciacco commentedon Aug 6, 2021
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:
This is the output in the console:
OS Name: Microsoft Windows 10 Home
OS Version: 10.0.19043 N/A Build 19043
Nativefier: 45.0.0 w/ Electron v13.1.7
kjmoore commentedon Oct 25, 2021
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-instanceunregister-worker.js:
Grunkhead commentedon Nov 24, 2021
@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.
Grunkhead commentedon Nov 24, 2021
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
README: add troubleshooting section for common issues (nativefier#1169)