Source code
Revision control
Copy as Markdown
Other Tools
<!DOCTYPE HTML>
<html>
<script>
// Set up a promise to wait for a response to our remote request.
window.remoteTroubleShootingResult = new Promise(resolve => {
window.addEventListener("WebChannelMessageToContent", function (event) {
if (event.detail.id == "remote-troubleshooting") {
// Store the result our DOM just for good measure/diagnostics.
document.getElementById("troubleshooting").textContent =
JSON.stringify(event.detail.message, null, 2);
resolve(event.detail.message);
}
});
});
// Make a request for the troubleshooting data as we load.
window.onload = function() {
var event = new window.CustomEvent("WebChannelMessageToChrome", {
detail: JSON.stringify({
id: "remote-troubleshooting",
message: {
command: "request",
},
}),
});
window.dispatchEvent(event);
};
</script>
<body>
<pre id="troubleshooting"/>
</body>
</html>