Closed jaredsohn closed 10 years ago
While troubleshooting this, I discovered the basic problem was I was misunderstanding how scope works in contentscripts (the reality is that even if contentscripts run under a different set of match criteria, they share the same scope.) Here, both contentscripts share the same __activation_id field.
Thus, I am closing this issue.
Here is a simplified version of my extension that exhibits the problem:
forge.message.listen( function(scriptname, reply) { reply(true); }, function(err) { console.log(err); } );
var activation_id = "$SCRIPT_NAME"; // set via tokenizing code forge.message.broadcastBackground(activation_id, activation_id, function(content) { console.log(__activation_id + " response: " + content) }, function(content) { console.log(activation_id + " response: " + content) });
Basically when I run this, my activations all talk to the background page and I would expect each to write to the console the reply they received. Unfortunately, I often experience one activation getting multiple responses and the others not getting any responses. There isn't a parameter to restrict the reply to certain listeners, but I would think that could and would be determined automatically.