|
@@ -10,8 +10,10 @@ import { bookmark, bunch_of_bookmarks, folder, unified_item } from '../../hosts/
|
|
|
import woofWantJump from '../../dialogs/prompts/woofWantJump';
|
|
import woofWantJump from '../../dialogs/prompts/woofWantJump';
|
|
|
import { bunch_of_downloads } from '../../hosts/bunch_of_downloads';
|
|
import { bunch_of_downloads } from '../../hosts/bunch_of_downloads';
|
|
|
import woofWantResources from '../../dialogs/prompts/woofWantProtectedResources';
|
|
import woofWantResources from '../../dialogs/prompts/woofWantProtectedResources';
|
|
|
-import { print } from '@kit.BasicServicesKit';
|
|
|
|
|
|
|
+import { BusinessError, print } from '@kit.BasicServicesKit';
|
|
|
import { print_web } from '../../utils/print_tools';
|
|
import { print_web } from '../../utils/print_tools';
|
|
|
|
|
+import { Want } from '@kit.AbilityKit';
|
|
|
|
|
+import { meowContext } from '../../utils/environment_tools';
|
|
|
|
|
|
|
|
@Component
|
|
@Component
|
|
|
struct meowWebView {
|
|
struct meowWebView {
|
|
@@ -433,6 +435,19 @@ struct meowWebView {
|
|
|
if (event) {
|
|
if (event) {
|
|
|
let url: string = event.data.getRequestUrl();
|
|
let url: string = event.data.getRequestUrl();
|
|
|
// Do not intercept data:
|
|
// Do not intercept data:
|
|
|
|
|
+ // 检查是否是华为应用市场网页版链接
|
|
|
|
|
+ if (url.includes('appgallery.huawei.com') || url.includes('haokan.baidu.com/download')) {
|
|
|
|
|
+ let want: Want = {
|
|
|
|
|
+ action: 'ohos.want.action.appdetail',
|
|
|
|
|
+ uri: 'store://appgallery.huawei.com/app/',
|
|
|
|
|
+ };
|
|
|
|
|
+ meowContext().startAbility(want).then(() => {
|
|
|
|
|
+ console.info("Succeeded in starting Ability successfully.")
|
|
|
|
|
+ }).catch((error: BusinessError) => {
|
|
|
|
|
+ console.error(`Failed to startAbility.Code: ${error.code}, message is ${error.message}`);
|
|
|
|
|
+ });
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
if (url.substring(0, 5) == 'data:') {
|
|
if (url.substring(0, 5) == 'data:') {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
@@ -443,8 +458,8 @@ struct meowWebView {
|
|
|
return false;
|
|
return false;
|
|
|
} else {
|
|
} else {
|
|
|
// Not viewable, perhaps is a link that can jump?
|
|
// Not viewable, perhaps is a link that can jump?
|
|
|
- this.potential_jump_link = url;
|
|
|
|
|
- this.woofLinkJumper_control.open();
|
|
|
|
|
|
|
+ // this.potential_jump_link = url;
|
|
|
|
|
+ // this.woofLinkJumper_control.open();
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|