1

Chromium/Chrome web browser apparently has a built-in support for opening a special window for Google Keep, WhatsApp, etc.

For example, the command chromium-browser --app=https://web.whatsapp.com/ effectively presents you with a nice, neat web-based desktop client for WhatsApp (with no tab bar, bookmark bar, etc.)

How can we achieve the same in Firefox which doesn't have a similar command option/parameter?

1

1) Make sure that you have ./chrome/userChrome.css under your user mozilla firefox profile directory (e.g. ~/.mozilla/firefox/*profile*/), and that it includes this line to suppress the navigation bar:

#main-window[title^="WhatsApp"] #nav-bar { visibility: collapse !important; }

2) Create an html file (e.g. ~/.bin/WhatsAppWeb) with the following contents to open WhatsApp Web in a popup window instead of a regular window:

<!DOCTYPE html>
<html lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>WhatsApp Web Launcher</title>
<script type="text/javascript">
window.open('https://web.whatsapp.com/','myWindow','width=670,height=900,top=0,left=1250');
</script>
</head>
<body>
</body>
</html>

3) Enter the command firefox -new-window "~/.bin/WhatsAppWeb" in a terminal window, and allow local file ~/.bin/WhatsAppWeb to open popup window from now on by saving this preference, and then close the firefox window(s).

4) Finally, whenever you want to start WhatsApp Web, run these commands - e.g. from terminal or a .desktop file, via bash script, etc.:

firefox -new-window "~/.bin/WhatsAppWeb" &
sleep 5s
wmctrl -ic "$(wmctrl -lp | grep "$(pgrep firefox)" | grep -v 'WhatsApp - Mozilla Firefox' | tail -1 | awk '{ print $1 }')"

In this last step, a WhatsApp Web popup window is launched from a new blank Firefox window, and then that blank window is closed after 5 seconds (which might need to be adjusted according to different conditions), thereby effectively opening a special Firefox window for WhatsApp Web only.

Note: This solution has been found thanks to Ginbread Man here: http://forums.mozillazine.org/viewtopic.php?f=38&t=3035313&p=14782570#p14782570

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.