Free widget
Add this free chocolate-toxicity checker to your site
If you write for dog owners — a clinic site, a shelter, a groomer, a pet blog — this is the tool your readers want at the exact moment they need it: how much chocolate their dog ate, and whether it is dangerous. Paste one snippet and it lives on your page. It is free, it needs no signup or API key, and it sets no cookies and runs no analytics on your readers.
Live demo
This is not a screenshot and not a rebuild — the markup below this heading is literally the snippet in the box further down, running here.
Dog Chocolate Toxicity Calculator by hearthcalc.com
The snippet
Paste it wherever you want the widget to appear. The small script only sets the frame's height so the widget never scrolls inside a box. Drop it and everything still works — the widget then falls back to the fixed heights in the style block, which fit it as it loads.
<!-- Free dog chocolate toxicity checker from hearthcalc.com -->
<style>
#hearthcalc-chocolate-widget { height: 920px }
@media (max-width: 660px) { #hearthcalc-chocolate-widget { height: 970px } }
@media (max-width: 499px) { #hearthcalc-chocolate-widget { height: 1060px } }
@media (max-width: 399px) { #hearthcalc-chocolate-widget { height: 1270px } }
</style>
<iframe
id="hearthcalc-chocolate-widget"
src="https://hearthcalc.com/dog-chocolate-toxicity-calculator/embed/"
title="Dog Chocolate Toxicity Calculator"
loading="lazy"
style="display:block;width:100%;border:1px solid #e6d9c2;border-radius:14px"
sandbox="allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation"
></iframe>
<p style="font-size:14px">
<a href="https://hearthcalc.com/dog-chocolate-toxicity-calculator">Dog Chocolate Toxicity Calculator</a> by hearthcalc.com
</p>
<script>
(function () {
var ORIGIN = 'https://hearthcalc.com';
var frame = document.getElementById('hearthcalc-chocolate-widget');
if (!frame) return;
function hello() {
if (frame.contentWindow) frame.contentWindow.postMessage({ type: 'hearthcalc:embed:hello' }, ORIGIN);
}
window.addEventListener('message', function (event) {
if (event.origin !== ORIGIN) return;
if (event.source !== frame.contentWindow) return;
var data = event.data;
if (!data || data.type !== 'hearthcalc:embed:size') return;
var height = Number(data.height);
if (!(height > 0) || height > 4000) return;
frame.style.height = height + 'px';
});
frame.addEventListener('load', hello);
hello();
})();
</script> The rules, in full
- Free, forever, for any site — commercial or not. No signup, no key, no quota, no invoice later.
- Keep the attribution. The widget carries a small "Powered by hearthcalc.com" line inside the frame. That link is what this costs; please don't hide, overlay or cover it. The credit line under the frame is yours to style or reword — we'd rather you kept it, and it is the part search engines can see.
- Don't remove the safety text. The disclaimer and the two poison-control numbers are part of the tool, not decoration, and they are rendered by us so they can't silently go stale on your page.
- Don't re-host or rebuild it. Embed the frame rather than copying the markup — an embedded frame gets every correction we make; a copy gets frozen numbers.
- We may change the widget. Sourced figures get corrected and the layout gets improved. We won't add ads, paywalls or reader tracking to it.
For whoever reviews the snippet
Fair questions if you're the one pasting this into a production template.
- What it loads: one HTML document from
hearthcalc.com, its stylesheet and one webfont. No third-party scripts, no analytics beacon, no cookies, no local storage. Nothing a visitor types into the widget ever leaves their browser — the arithmetic runs client-side, and the only message the frame sends out is its own pixel height. - Why
allow-same-originis in the sandbox: without it the frame gets an opaque origin, which means neither side can name the other and the height message would have to be broadcast with a wildcard target. We would rather grant the frame its own real origin —hearthcalc.com, which is not your origin, so it confers nothing over your page — and have both sides check exactly who they are talking to. Remove it if you prefer; the widget then falls back to its fixed height. - Content Security Policy: if your site sets one, the widget needs
frame-src https://hearthcalc.com. - It's not medical advice, and the widget says so where your readers can see it. It estimates a theobromine dose from published veterinary figures and tells the reader to call a vet or a poison-control line. The full method and every source are on the calculator page.