Describe the bugsox.helpers.addAjaxListener calls sox.helpers.runAjaxHooks, which wraps and replaces XMLHttpRequest.prototype.open. This works fine the first time runAjaxHooks is called, but upon following calls, it re-wraps itself recursively. Each time this happens, all the listeners will be run one more time when triggered. I first noticed this when tag wiki links started getting duplicated in the tag mouseover popup.
To reproduce
Enable Appearance-showTagWikiLinkOnTagPopup and another feature that uses an AJAX listener on a question page (e.g. Appearance-dragBounty, Appearance-standOutDupeCloseMigrated)
Go to a question
Mouse over a tag
See multiple tag wiki links (N = number of addAjaxListener calls)
Expected behaviourrunAjaxHooks should remember if it's been run before, and do nothing if so.
Describe the bug
sox.helpers.addAjaxListener
callssox.helpers.runAjaxHooks
, which wraps and replacesXMLHttpRequest.prototype.open
. This works fine the first timerunAjaxHooks
is called, but upon following calls, it re-wraps itself recursively. Each time this happens, all the listeners will be run one more time when triggered. I first noticed this when tag wiki links started getting duplicated in the tag mouseover popup.To reproduce
Appearance-showTagWikiLinkOnTagPopup
and another feature that uses an AJAX listener on a question page (e.g.Appearance-dragBounty
,Appearance-standOutDupeCloseMigrated
)addAjaxListener
calls)Expected behaviour
runAjaxHooks
should remember if it's been run before, and do nothing if so.Screenshots/GIFs
Environment Chrome 111.0.5563.146, SOX 2.8.4 DEV, Tampermonkey