You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I hate Firefox's extension update method so much. You have no idea.
Sorry, anyway, right, the bug report. We add an event listener on xkitinjectionrequest to handle injected functions in the "main world" context when the extension boots; on Firefox this occurs when you toggle the extension off-and-on or when it gets autoupdated silently in the background. Firefox invalidates old event listeners from the previous invocation of the extension when this happens... but not this one. Therefore, both versions of the listener exist in this case.
All injected functions are therefore run twice (or n times, if you simply toggle the extension off and on n times) each time they're supposed to be run; this includes things like quick reblog's reblog of a post.
This is, obviously and notably, the opposite of #1551, and I don't understand this; the fact that I had to implement that fix sort of implies that this shouldn't be a problem; looking at it another way, the fact that that fix causes this problem implies that I shouldn't have had to implement that fix?
But, like, whatever. Presumably we should put a data attribute on the main world script element with a random string and append that to the relevant event names. (Or set a property on window to a random value and don't respond to events if that value has changed, or something; that doesn't work if the pre-update version does not have that code, so one would have to do some other things as well—there may be better #1538-compatible solutions, but that's what I came up with off the dome).
The text was updated successfully, but these errors were encountered:
I would love if there was a way to just have the event listener itself cancel the rest of the identical listeners (stopImmediatePropagation?), but apparently listeners are run in registration order and we want the opposite of that.
Platform
macOS 14.4.1 arm64
Browser
Firefox 129.0b9
Addon version
1.0.2
Details
I hate Firefox's extension update method so much. You have no idea.
Sorry, anyway, right, the bug report. We add an event listener on
xkitinjectionrequest
to handle injected functions in the "main world" context when the extension boots; on Firefox this occurs when you toggle the extension off-and-on or when it gets autoupdated silently in the background. Firefox invalidates old event listeners from the previous invocation of the extension when this happens... but not this one. Therefore, both versions of the listener exist in this case.All injected functions are therefore run twice (or n times, if you simply toggle the extension off and on n times) each time they're supposed to be run; this includes things like quick reblog's reblog of a post.
This is, obviously and notably, the opposite of #1551, and I don't understand this; the fact that I had to implement that fix sort of implies that this shouldn't be a problem; looking at it another way, the fact that that fix causes this problem implies that I shouldn't have had to implement that fix?
But, like, whatever. Presumably we should put a data attribute on the main world script element with a random string and append that to the relevant event names. (Or set a property on
window
to a random value and don't respond to events if that value has changed, or something; that doesn't work if the pre-update version does not have that code, so one would have to do some other things as well—there may be better #1538-compatible solutions, but that's what I came up with off the dome).The text was updated successfully, but these errors were encountered: