drAIML / webgpu /extension /content.js
Gregory-L's picture
Professor Codephreak
WebGPU helper: check page, browser extension and installers
7e173d8 verified
Raw History Blame Contribute Delete
584 Bytes
// SPDX-License-Identifier: MIT
// drAIML WebGPU helper · on drAIML's pages only. Tells the page the helper is installed (so its donation panel can offer
// "check my graphics card"), and opens the check when the page asks. It reads nothing from the page.
const api = typeof browser !== "undefined" ? browser : chrome;
document.documentElement.dataset.webgpuHelper = api.runtime.getManifest().version;
window.addEventListener("message", (e) => {
if (e.source === window && e.data && e.data.type === "draiml-webgpu-helper:open") api.runtime.sendMessage({ type: "open-check" });
});