1
0
mirror of https://github.com/maximebf/php-debugbar.git synced 2025-01-16 21:08:34 +01:00

Fix event listener when url is object (#519)

This commit is contained in:
Danilo Pinotti 2023-02-04 12:26:33 -03:00 committed by GitHub
parent 1c2a5300cc
commit cd5e33f3cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1207,7 +1207,9 @@ if (typeof(PhpDebugBar) == 'undefined') {
var xhr = this;
this.addEventListener("readystatechange", function() {
var skipUrl = self.debugbar.openHandler ? self.debugbar.openHandler.get('url') : null;
if (xhr.readyState == 4 && url.indexOf(skipUrl) !== 0) {
var href = (typeof url === 'string') ? url : url.href;
if (xhr.readyState == 4 && href.indexOf(skipUrl) !== 0) {
self.handle(xhr);
}
}, false);