Skip to content

Commit cd5e33f

Browse files
Fix event listener when url is object (php-debugbar#519)
1 parent 1c2a530 commit cd5e33f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/DebugBar/Resources/debugbar.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1207,7 +1207,9 @@ if (typeof(PhpDebugBar) == 'undefined') {
12071207
var xhr = this;
12081208
this.addEventListener("readystatechange", function() {
12091209
var skipUrl = self.debugbar.openHandler ? self.debugbar.openHandler.get('url') : null;
1210-
if (xhr.readyState == 4 && url.indexOf(skipUrl) !== 0) {
1210+
var href = (typeof url === 'string') ? url : url.href;
1211+
1212+
if (xhr.readyState == 4 && href.indexOf(skipUrl) !== 0) {
12111213
self.handle(xhr);
12121214
}
12131215
}, false);

0 commit comments

Comments
 (0)