<!DOCTYPE html>
<html>
<head>
<style>
html,
body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
}
body {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
.buttons {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
button {
margin-bottom: 0.5rem;
}
</style>
</head>
<body>
<h1>sentry-tauri</h1>
<div class="buttons">
<button id="js-breadcrumb">JavaScript Breadcrumb</button>
<button id="rust-breadcrumb">Rust Breadcrumb</button>
<button id="js-error">JavaScript Error</button>
<button id="rust-panic">Rust Panic</button>
<button id="native-crash">Native Crash</button>
</div>
<script>
function aFunctionThatThrows() {
throw new Error("This is a JavaScript Error");
}
window.addEventListener("DOMContentLoaded", (event) => {
window.document
.getElementById("js-breadcrumb")
.addEventListener("click", () => {
Sentry.addBreadcrumb({
message: "This is a breadcrumb from JavaScript",
});
});
window.document
.getElementById("js-error")
.addEventListener("click", () => {
aFunctionThatThrows();
});
window.document
.getElementById("rust-breadcrumb")
.addEventListener("click", () => {
window.__TAURI__.invoke("rust_breadcrumb");
});
window.document
.getElementById("rust-panic")
.addEventListener("click", () => {
window.__TAURI__.invoke("rust_panic");
});
window.document
.getElementById("native-crash")
.addEventListener("click", () => {
window.__TAURI__.invoke("native_crash");
});
});
</script>
</body>
</html>