From 7f401310a60b86d5810d48791ebd36979b009dd5 Mon Sep 17 00:00:00 2001 From: sfchu Date: Tue, 1 Apr 2025 11:29:46 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E3=80=90=E5=9F=BA=E4=BA=8E=E9=A2=84?= =?UTF-8?q?=E6=B8=B2=E6=9F=93=E6=8A=80=E6=9C=AF=E5=AE=9E=E7=8E=B0Web?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=9E=AC=E5=BC=80=E6=95=88=E6=9E=9C=E3=80=91?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/common/BreakpointSystem.ets | 2 +- entry/src/main/ets/common/Constants.ets | 12 +----------- entry/src/main/ets/common/ResourceUtil.ets | 4 +++- entry/src/main/ets/entryability/EntryAbility.ets | 6 +++--- entry/src/main/ets/pages/Index.ets | 2 +- entry/src/main/ets/pages/WebPage.ets | 5 ++--- 6 files changed, 11 insertions(+), 20 deletions(-) diff --git a/entry/src/main/ets/common/BreakpointSystem.ets b/entry/src/main/ets/common/BreakpointSystem.ets index af587b3..9abc023 100644 --- a/entry/src/main/ets/common/BreakpointSystem.ets +++ b/entry/src/main/ets/common/BreakpointSystem.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/entry/src/main/ets/common/Constants.ets b/entry/src/main/ets/common/Constants.ets index 093e1e2..746cbd1 100644 --- a/entry/src/main/ets/common/Constants.ets +++ b/entry/src/main/ets/common/Constants.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * Copyright (c) 2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -14,16 +14,6 @@ */ export class Constants { - /** - * Text border radius. - */ - public static readonly TEXT_BORDER_RADIUS: number = 16; - - /** - * Background color. - */ - public static readonly BACK_COLOR: string = '#F1F3F5'; - /** * All breakpoints */ diff --git a/entry/src/main/ets/common/ResourceUtil.ets b/entry/src/main/ets/common/ResourceUtil.ets index c747200..dbbf48f 100644 --- a/entry/src/main/ets/common/ResourceUtil.ets +++ b/entry/src/main/ets/common/ResourceUtil.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * Copyright (c) 2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the 'License'); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,6 +13,7 @@ * limitations under the License. */ +import { hilog } from '@kit.PerformanceAnalysisKit'; import { JSON, util } from '@kit.ArkTS'; export class ResourceUtil { @@ -29,6 +30,7 @@ export class ResourceUtil { try { resourceString = context.resourceManager.getStringSync(resource.id); } catch (error) { + hilog.error(0x0000, 'WebviewController', '%{public}s', `error: ${error}`); } return resourceString; } diff --git a/entry/src/main/ets/entryability/EntryAbility.ets b/entry/src/main/ets/entryability/EntryAbility.ets index 39b4f27..f6db33f 100644 --- a/entry/src/main/ets/entryability/EntryAbility.ets +++ b/entry/src/main/ets/entryability/EntryAbility.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * Copyright (c) 2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -41,7 +41,7 @@ export default class EntryAbility extends UIAbility { AppStorage.setOrCreate('currentBreakpoint', this.curBp); } } catch (error) { - hilog.info(0x0000, 'updateBreakpoint', '%{public}s', `updateBreakpoint fail, err: ${JSON.stringify(error)}`); + hilog.error(0x0000, 'updateBreakpoint', '%{public}s', `updateBreakpoint fail, err: ${JSON.stringify(error)}`); } } @@ -96,7 +96,7 @@ export default class EntryAbility extends UIAbility { let windowClass: window.Window = windowStage.getMainWindowSync(); let isLayoutFullScreen = true; windowClass.setWindowLayoutFullScreen(isLayoutFullScreen).then(() => { - console.info('Succeeded in setting the window layout to full-screen mode.'); + hilog.info(0x0000, 'testTag', '%{public}s', 'Succeeded in setting the window layout to full-screen mode.'); }).catch((err: BusinessError) => { console.error('Failed to set the window layout to full-screen mode. Cause:' + JSON.stringify(err)); }); diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index d336974..e34c154 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * Copyright (c) 2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/entry/src/main/ets/pages/WebPage.ets b/entry/src/main/ets/pages/WebPage.ets index 6619398..3b7a186 100644 --- a/entry/src/main/ets/pages/WebPage.ets +++ b/entry/src/main/ets/pages/WebPage.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * Copyright (c) 2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -36,8 +36,7 @@ function webBuilder(data: Data) { // Set the whitelist to allow access to only the trust web page. data.controller.setUrlTrustList(Constants.URL_TRUST); } catch (error) { - hilog.info(0x0000, 'WebviewController', '%{public}s', - `ErrorCode: ${(error as BusinessError).code}, Message: ${(error as BusinessError).message}`); + hilog.error(0x0000, 'WebviewController', '%{public}s', `error: ${error}`); } }) .width($r('app.string.full_height_width')) -- Gitee From de81c069d41df700c84a126e1f3e13727d8b4b23 Mon Sep 17 00:00:00 2001 From: sfchu Date: Tue, 1 Apr 2025 11:33:24 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E3=80=90=E5=9F=BA=E4=BA=8E=E9=A2=84?= =?UTF-8?q?=E6=B8=B2=E6=9F=93=E6=8A=80=E6=9C=AF=E5=AE=9E=E7=8E=B0Web?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=9E=AC=E5=BC=80=E6=95=88=E6=9E=9C=E3=80=91?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/common/BreakpointSystem.ets | 2 +- entry/src/main/ets/common/Constants.ets | 2 +- entry/src/main/ets/common/ResourceUtil.ets | 2 +- entry/src/main/ets/entryability/EntryAbility.ets | 2 +- entry/src/main/ets/pages/Index.ets | 2 +- entry/src/main/ets/pages/WebPage.ets | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/entry/src/main/ets/common/BreakpointSystem.ets b/entry/src/main/ets/common/BreakpointSystem.ets index 9abc023..2fe9c52 100644 --- a/entry/src/main/ets/common/BreakpointSystem.ets +++ b/entry/src/main/ets/common/BreakpointSystem.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/entry/src/main/ets/common/Constants.ets b/entry/src/main/ets/common/Constants.ets index 746cbd1..49c8670 100644 --- a/entry/src/main/ets/common/Constants.ets +++ b/entry/src/main/ets/common/Constants.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/entry/src/main/ets/common/ResourceUtil.ets b/entry/src/main/ets/common/ResourceUtil.ets index dbbf48f..9709127 100644 --- a/entry/src/main/ets/common/ResourceUtil.ets +++ b/entry/src/main/ets/common/ResourceUtil.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the 'License'); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/entry/src/main/ets/entryability/EntryAbility.ets b/entry/src/main/ets/entryability/EntryAbility.ets index f6db33f..ce47029 100644 --- a/entry/src/main/ets/entryability/EntryAbility.ets +++ b/entry/src/main/ets/entryability/EntryAbility.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index e34c154..d336974 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/entry/src/main/ets/pages/WebPage.ets b/entry/src/main/ets/pages/WebPage.ets index 3b7a186..e123b06 100644 --- a/entry/src/main/ets/pages/WebPage.ets +++ b/entry/src/main/ets/pages/WebPage.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at -- Gitee From 09603a85fe74bb6a38b9d3903e833c44463c1d62 Mon Sep 17 00:00:00 2001 From: sfchu Date: Tue, 1 Apr 2025 15:24:38 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E3=80=90=E5=9F=BA=E4=BA=8E=E9=A2=84?= =?UTF-8?q?=E6=B8=B2=E6=9F=93=E6=8A=80=E6=9C=AF=E5=AE=9E=E7=8E=B0Web?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=9E=AC=E5=BC=80=E6=95=88=E6=9E=9C=E3=80=91?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/entryability/EntryAbility.ets | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/entry/src/main/ets/entryability/EntryAbility.ets b/entry/src/main/ets/entryability/EntryAbility.ets index ce47029..4f3cf04 100644 --- a/entry/src/main/ets/entryability/EntryAbility.ets +++ b/entry/src/main/ets/entryability/EntryAbility.ets @@ -98,7 +98,8 @@ export default class EntryAbility extends UIAbility { windowClass.setWindowLayoutFullScreen(isLayoutFullScreen).then(() => { hilog.info(0x0000, 'testTag', '%{public}s', 'Succeeded in setting the window layout to full-screen mode.'); }).catch((err: BusinessError) => { - console.error('Failed to set the window layout to full-screen mode. Cause:' + JSON.stringify(err)); + hilog.error(0x0000, 'testTag', '%{public}s', + `Failed to set the window layout to full-screen mode. Cause:${err}`); }); }); } -- Gitee From d2d4fdf8338c0d4e0fb3a522ed7ff8bfe22e2487 Mon Sep 17 00:00:00 2001 From: sfchu Date: Tue, 1 Apr 2025 16:40:22 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E3=80=90=E5=9F=BA=E4=BA=8E=E9=A2=84?= =?UTF-8?q?=E6=B8=B2=E6=9F=93=E6=8A=80=E6=9C=AF=E5=AE=9E=E7=8E=B0Web?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=9E=AC=E5=BC=80=E6=95=88=E6=9E=9C=E3=80=91?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/pages/WebPage.ets | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/entry/src/main/ets/pages/WebPage.ets b/entry/src/main/ets/pages/WebPage.ets index e123b06..29cbf39 100644 --- a/entry/src/main/ets/pages/WebPage.ets +++ b/entry/src/main/ets/pages/WebPage.ets @@ -14,7 +14,6 @@ */ import { UIContext, NodeController, BuilderNode, FrameNode } from '@kit.ArkUI'; -import { BusinessError } from '@kit.BasicServicesKit'; import { hilog } from '@kit.PerformanceAnalysisKit'; import { common } from '@kit.AbilityKit'; import { webview } from '@kit.ArkWeb'; @@ -39,6 +38,11 @@ function webBuilder(data: Data) { hilog.error(0x0000, 'WebviewController', '%{public}s', `error: ${error}`); } }) + .onSslErrorEventReceive((event) => { + hilog.info(0x0000, 'onSslErrorEventReceive', '%{public}s', + `ssl check failed, error is :${event.error.toString()}`); + event.handler.handleCancel(); + }) .width($r('app.string.full_height_width')) .height($r('app.string.full_height_width')) .domStorageAccess(true) -- Gitee