I am currently developing a Firefox extension that requires keeping multiple windows synchronized with the same information. The toolbar in each window queries a remote server periodically, but since Firefox windows are isolated environments with their own toolbars and code, I decided to implement a singleton pattern. This allows for a single request for each window, preventing unnecessary duplication of requests. However, the challenge lies in not having a global master scope to manage the different window contexts.
To address this issue, I opted to create a factory class that checks if an instance of my notification class is already running in one of the windows. If found, it utilizes the existing instance for updates instead of creating a new one. While this approach seems practical to me, I have encountered warnings about singletons being considered problematic. Can someone clarify if this usage is appropriate?