DebugR

#0 / 0 rate

DebugR

30 users

2018-05-16

Bob Fanger

Extension Information

5 star
0%
4 star
0%
3 star
0%
2 star
0%
1 star
0%

Supported Languages

Permissions

Description

Receive debugging information alongside XMLHttpRequests.

Server code (example is php, but the extension is language agnostic):

if (isset($_SERVER['HTTP_DEBUGR'])) { // Only send headers when DebugR is enabled
// Send a message alongside the request.
header('DebugR: '.base64_encode('Hello DebugR'));
// Append a unique label to send multiple messages.
header('DebugR-my-first-label: '.base64_encode('Moarr information'));
}
?>

Client via javascript:

window.addEventListener('message', function (e) {
if (e.data.debugR) {
console.log(e.data);
}
}, false);
document.documentElement.setAttribute('data-debugR'); // Signal the extension that the eventlistener is active.

Using debugr.js helper: