Add-on disabled after a minute of idling

So I have a simple add-on that consists of a button. When pressed, the button searches the current page for a specific html element, then modifies the contents of that element.

The issue I’m running in to is that if the page has been idle for more than a minute or so, the button does not function.

When testing, my console throws a warning after some idle time which I assume is the cause…

[NPAPI 8660] WARNING: pipe error: 109: file c:/builds/moz2_slave/rel-m-rel-w32_bld-000000000000/build/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 333"

Some searching led me to some defects found between Firefox and Chrome but I am not positive if those are related.
(i.e. https://bugzilla.mozilla.org/show_bug.cgi?id=1101993 )

Anyone know any more about this?

Cheers
T

This is odd, this seems to be an addon issue not a browser issue. Unless maybe its not signed version of addon and its getting disabled with delay or something.

Thanks for the response. Now that you mention it, it is an unsigned add-on that I’m using for colleagues in my office. If I get it signed, does that mean the public has access to it or can I keep it private?

Signing has nothing to do with this. Signing is only enforced on install time, and isn’t active in current release versions of Firefox. I’m not sure if the error has to do with your add-on or not. I think it’d be useful if you show us your code so we can try to spot the problem.

Thanks for responding Jorge… here’s what I have:

main.js

var buttons = require('sdk/ui/button/action');
 var tabs = require("sdk/tabs");
 var self = require("sdk/self");
 var button = buttons.ActionButton({
    id: "r0d",
    label: "R0D",
    icon: {
       "16": "./r0d.png"
    },
   onClick: handleClick
 });

tabs.on("ready", function(tab) {
    worker = tab.attach({
        contentScriptFile: self.data.url("grabber.js")
    });
    worker.port.emit("Marco!", "Polo!");
    worker.port.on("Polo!", function goGUID(myGUID) { newGUID = myGUID; } );
});

function handleClick(state) {
    if(typeof newGUID === 'undefined') {
    } else {
        tabs.open("http://removed" + newGUID);
        delete newGUID;
   }
}

grabber.js

 self.port.on("Marco!", function(message) {
      var myGUID = document.getElementById('ContentPlaceHolder_labelGUID'); 
      myGUID = myGUID.innerHTML;
      self.port.emit("Polo!", myGUID);
  });

That looks like it should not affect enable/disable status at all. Can you upload your full addon to github and link it to us. If possible can you do cfx make or jpm make and upload xpi as well.

Here’s a fun thing you can try though, set up a listener on your addon id to see when exactly it changes:

Cu.import('resource://gre/modules/AddonManager.jsm');
var addonListener = {
    onPropertyChanged: function(addon, properties) {
        //console.log('props changed on addon:', addon.id, 'properties:', properties);
        if (addon.id == 'type your id heree!!!!!!!!!!!!') {
            console.info('change on property of:', addon);
        }
    }
};

AddonManager.addAddonListener(addonListener);

Tracing execution in the console is definitely a good idea. It’s possible that the event handler is failing silently for many reasons.