I am busy developing a Firefox extension and I have a Widget that opens a Panel. How do I have a background script that is constantly running/polling the server to fetch updates. These updates would then need to be injected into the DOM of the Panel.
Share
All of your extension scripts are “background scripts”. What you are asking about seems to be a way to poll the server regularly – you use the
timersmodule for that, methodsetInterval(). The callback would than use therequestmodule to send a request to the server.As to communicating information to a widget/panel – you use the usual approach to send messages to the content scripts running there.