I know the chances two different messages will have same ID using messageID = Math.random() are close to 0%, but as the application runs and there are more and more messages, the collision probability increases.
I added a counter variable _unique_id_ to make sure messageID is unique per thread/module. The random part make it unique at Add-on level.
P.S. Sorry for extra lines touched, my editor removes trailing white spaces.
Thanks for the patches!
If you have more spare time, it would be awesome if you update browser-action-jplib to use the sdk/ui APIs when they are available.
I know the chances two different messages will have same ID using
messageID = Math.random()
are close to 0%, but as the application runs and there are more and more messages, the collision probability increases.I added a counter variable
_unique_id_
to make suremessageID
is unique per thread/module. The random part make it unique at Add-on level.P.S. Sorry for extra lines touched, my editor removes trailing white spaces.