Skip to content

Commit 72a4f92

Browse files
committed
Add many origins to the trusted fetch origins list
*.turbowarp.org and *.turbowarp.xyz are now always allowed, so trampoline is always allowed The APIs of GitHub, GiitLab, Itch, GameJolt, and httpbin are now allowed Closes #717
1 parent f3b1cf9 commit 72a4f92

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

src/containers/tw-security-manager.jsx

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,28 @@ const isAlwaysTrustedForFetching = parsed => (
3939
// If we would trust loading an extension from here, we can trust loading resources too.
4040
isTrustedExtension(parsed.href) ||
4141

42+
// Any TurboWarp service such as trampoline
43+
parsed.origin === 'https://turbowarp.org' ||
44+
/\.turbowarp\.org$/.test(parsed.origin) ||
45+
/\.turbowarp\.xyz$/.test(parsed.origin) ||
46+
4247
// GitHub
4348
parsed.origin === 'https://raw.githubusercontent.com' ||
44-
/^https:\/\/[a-z0-9-]{1,40}\.github\.io$/.test(parsed.origin) ||
49+
parsed.origin === 'https://api.github.com' ||
50+
/\.github\.io$/.test(parsed.origin) ||
4551

4652
// GitLab
47-
/^https:\/\/[a-z0-9_.-]{1,255}\.gitlab\.io$/.test(parsed.origin)
53+
parsed.origin === 'https://gitlab.com' ||
54+
/\.gitlab\.io$/.test(parsed.origin) ||
55+
56+
// Itch
57+
/\.itch\.io$/ ||
58+
59+
// GameJolt
60+
parsed.origin === 'https://api.gamejolt.com' ||
61+
62+
// httpbin
63+
parsed.origin === 'https://httpbin.org'
4864
);
4965

5066
/**

0 commit comments

Comments
 (0)