I have to make a small modification on a legacy addon built in Addon SDK that's why I am not using webextension. I am trying to make a background script that should be running in the background as long as the addon is installed. I have an HTML panel and there is a script that is attached to it. But the panel's script runs only when the button is clicked. I tried to make another panel and attach the background script to it simply as:
var panels = require("sdk/panel");
var backgroundPanel = panels.Panel({
contentScriptFile: "./background.js"
});
But the background.js
never runs. How to run a script on the background automatically as long as the addon is installed without the need to be triggered?