Electron — Getting the tray right

Electron has been coming up as the choice of frame work to be used when porting a project which was formerly a web app to a desktop app (or adding additional functionalities when using the web app over on desktop — the case we handled at P2P.inc)

Problems with the default setup

The tray in electron serves as a quick access to the application’s functionalities without necessarily fiddling around with the application window itself.

However, the actual usage goes much deeper than the above mentioned definition and is often overlooked until teams start running into major issues because of not configuring their tray correctly!

Nonfunctional keyboard shortcuts — Mac

You might be surprised to know that unless you configure your tray code correctly, the general accelerators like CMD+C CMD+V to certain mac specific accelerators like CMD+Q and CMD+W won’t work at all.

It’s funny to think, but we need to explicitly define these in order to make sure simple events like copy paste work fine

Things that show up on mac will not show up on windows

While this is a no brainer at the first look, there are many things that will not show up the same way they do on mac vs on windows! This further emphasizes the fact that development teams need to ensure that they use a variety OS’s while developing/performing QA even if electron has a general perception of being set-it-up once and run it on any OS. We ran into this while adding a visual view to the working timer that employee's run while working - this timer gets displayed and refreshed by the tray's title - an API only available on mac!

These were the things I came across while developing a cross-platform app using electron! Hope this proves helpful to your team!

Originally published at https://viral98.github.io on January 25, 2021.




My work straddles around webRTC, noise reduction, and everything to do with audio over the web

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

LAMBDA — A Serverless Musical

Microservices 101: An Introduction Into Microservice Architecture

Deploy Certificate Authority Service on Kubernetes

Looking At Coding Bootcamps? 5 Things To Watch For

How Monitoring Can Help With Optimizing & Tuning MySQL / MariaDB Databases

Flink Development Platform: Apache Zeppelin (Part-5) Recovering

HC-SR04 Ultrasonic Sensor Python Class for Raspberry Pi

Python for Kids

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Viral Tagdiwala

Viral Tagdiwala

My work straddles around webRTC, noise reduction, and everything to do with audio over the web

More from Medium

Supercharged Visual Studio Code — Part 1

Why do we need to write tests

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed — JavaScript heap out of…

The Ultimate Guide to TypeScript Monorepos