mirror of
https://github.com/cupcakearmy/blaze.git
synced 2024-12-22 16:26:26 +00:00
15 lines
468 B
TypeScript
15 lines
468 B
TypeScript
export const blazeUrl = process.env.DEV_MODE
|
|
? "http://localhost:8888"
|
|
: "https://blaze.cyclic.app";
|
|
|
|
export function injectBlazeToPageLinks(blazeUrl: string) {
|
|
window.addEventListener("DOMContentLoaded", () => {
|
|
const links = document.querySelectorAll("a");
|
|
console.log(links);
|
|
links.forEach((link) => {
|
|
const originalHref = link.getAttribute("href");
|
|
link.setAttribute("href", `${blazeUrl}/blazed?url=${originalHref}`);
|
|
});
|
|
});
|
|
}
|