fix: injected console cannot effect on iOS

This commit is contained in:
pengfei.zhou
2022-07-18 11:34:43 +08:00
committed by osborn
parent b5ec211c6c
commit eef531d839
8 changed files with 22 additions and 8 deletions

View File

@@ -276,7 +276,9 @@ export function jsObtainEntry(contextId) {
};
}
const global = Function('return this')();
if (!Reflect.has(global, "console")) {
if (Environment.platform === 'Android'
|| Environment.platform === 'iOS'
|| Environment.platform === 'Qt') {
Reflect.set(global, "console", {
warn: logw,
error: loge,