Skip to content

Commit 58c700f

Browse files
committed
refactor(dom): add warning to 'addTrustedOrigin'
1 parent 09b16c1 commit 58c700f

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

packages/core/src/dom/IFrameManager.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ export class IframeManager {
4949
/**
5050
* Adds a domain to the trusted whitelist.
5151
*
52-
* @param origin - The origin to trust (e.g., "https://coocoodaegap.com").
52+
* @param origin - The origin to trust (e.g., "https://example.com").
5353
*/
5454
public addTrustedOrigin(origin: string): void {
5555
if (origin === '*') {
56-
if (!import.meta.env?.DEV)
57-
throw new Error(
58-
'[OmniPad-Security] Wildcard origin is not allowed. ' +
59-
'Please specify explicit origins (e.g., "https://coocoodaegap.com").',
60-
);
56+
console.error('[OmniPad-IPC] Using wildcard origin is UNSAFE!');
57+
console.error('For production, use: addTrustedOrigin("https://example.com")');
58+
if (!import.meta.env?.DEV) {
59+
throw new Error('Wildcard origin forbidden in production.');
60+
}
6161
}
6262
// 验证 origin 格式
6363
if (!/^https?:\/\//.test(origin)) {

0 commit comments

Comments
 (0)