Skip to content

Commit e5470ba

Browse files
committed
Only call runAjaxHooks once (after first regex-function mapping added)
Fixes #504.
1 parent 96c014a commit e5470ba

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

sox.common.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,11 @@
500500
if (regexToMatch) {
501501
hookAjaxObject[regexToMatch] = functionToExecute;
502502
}
503-
sox.helpers.runAjaxHooks();
503+
504+
// Only override the XMLHttpRequest.prototype.open function once (after adding the first regex-function mapping)
505+
if (Object.keys(hookAjaxObject).length <= 1) {
506+
sox.helpers.runAjaxHooks();
507+
}
504508
},
505509
};
506510

sox.user.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// @namespace https://github.com/soscripted/sox
44
// @homepage https://github.com/soscripted/sox
55
// @homepageURL https://github.com/soscripted/sox
6-
// @version 2.8.5 DEV
6+
// @version 2.8.6 DEV
77
// @description Extra optional features for Stack Overflow and Stack Exchange sites
88
// @contributor ᴉʞuǝ (https://stackoverflow.com/users/1454538/, https://github.com/mezmi)
99
// @contributor ᔕᖺᘎᕊ (https://stackexchange.com/users/4337810/, https://github.com/shu8)

0 commit comments

Comments
 (0)