mirror of
https://github.com/revoltchat/revite.git
synced 2024-12-25 07:02:10 -05:00
Update Renderer.tsx
This commit is contained in:
parent
852cc22dc2
commit
c4b881a525
1 changed files with 8 additions and 1 deletions
|
@ -32,6 +32,13 @@ declare global {
|
|||
}
|
||||
}
|
||||
|
||||
const ALLOWED_ORIGINS = [
|
||||
location.hostname,
|
||||
'app.revolt.chat',
|
||||
'nightly.revolt.chat',
|
||||
'local.revolt.chat',
|
||||
];
|
||||
|
||||
// Handler for code block copy.
|
||||
if (typeof window !== "undefined") {
|
||||
window.copycode = function (element: HTMLDivElement) {
|
||||
|
@ -172,7 +179,7 @@ export default function Renderer({ content, disallowBigEmoji }: MarkdownProps) {
|
|||
try {
|
||||
const url = new URL(href, location.href);
|
||||
|
||||
if (url.hostname.replace(/^[^.]+\./g, "") === location.hostname.replace(/^[^.]+\./g, "") && ["nightly.", "app.", "local."].includes(url.hostname.match(/^[^.]+\./g)?.[0] ?? "")) {
|
||||
if (ALLOWED_ORIGINS.includes(url.hostname)) {
|
||||
internal = true;
|
||||
element.addEventListener(
|
||||
"click",
|
||||
|
|
Loading…
Reference in a new issue