import { apiInitializer } from "discourse/lib/api";
export default apiInitializer("1.0", (api) => {
api.onPageChange((url) => {
// url은 보통 경로(path)입니다.
// 하지만 일부 컨텍스트에서는 전체 URL이 될 수 있으므로, 두 경우를 모두 처리합니다.
const path = url?.startsWith("http") ? new URL(url).pathname : url;
if (path === "/123") {
window.location.replace("https://dell.com/234");
}
});