feat(sdk): broaden goView iframe/video detection
This commit is contained in:
parent
1d2a712f70
commit
ca3f5670e8
@ -123,10 +123,16 @@ function isIframe(c: GoViewComponentLike): boolean {
|
|||||||
k.includes('browser') ||
|
k.includes('browser') ||
|
||||||
k.includes('webpage') ||
|
k.includes('webpage') ||
|
||||||
k.includes('website') ||
|
k.includes('website') ||
|
||||||
|
// Chinese low-code widgets / dashboards sometimes label this more directly.
|
||||||
|
k.includes('网页') ||
|
||||||
|
k.includes('嵌入') ||
|
||||||
|
k.includes('内嵌') ||
|
||||||
|
k.includes('页面') ||
|
||||||
// Chinese low-code widgets sometimes call this H5.
|
// Chinese low-code widgets sometimes call this H5.
|
||||||
k === 'h5' ||
|
k === 'h5' ||
|
||||||
k.includes('h5_') ||
|
k.includes('h5_') ||
|
||||||
k.includes('_h5') ||
|
k.includes('_h5') ||
|
||||||
|
k.includes('h5页面') ||
|
||||||
// keep the plain 'web' check last; it's broad and may overlap other widgets.
|
// keep the plain 'web' check last; it's broad and may overlap other widgets.
|
||||||
k === 'web' ||
|
k === 'web' ||
|
||||||
k.endsWith('_web') ||
|
k.endsWith('_web') ||
|
||||||
@ -150,6 +156,17 @@ function isVideo(c: GoViewComponentLike): boolean {
|
|||||||
// Misspellings / aliases seen in forks.
|
// Misspellings / aliases seen in forks.
|
||||||
if (k.includes('vedio')) return true;
|
if (k.includes('vedio')) return true;
|
||||||
|
|
||||||
|
// Chinese low-code widget names.
|
||||||
|
if (
|
||||||
|
k.includes('视频') ||
|
||||||
|
k.includes('监控') ||
|
||||||
|
k.includes('直播') ||
|
||||||
|
k.includes('摄像') ||
|
||||||
|
k.includes('摄像头')
|
||||||
|
) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// Other names seen in the wild.
|
// Other names seen in the wild.
|
||||||
return (
|
return (
|
||||||
k.includes('mp4') ||
|
k.includes('mp4') ||
|
||||||
@ -270,6 +287,9 @@ function looksLikeVideoOption(option: unknown): boolean {
|
|||||||
if (
|
if (
|
||||||
'videoUrl' in o ||
|
'videoUrl' in o ||
|
||||||
'videoSrc' in o ||
|
'videoSrc' in o ||
|
||||||
|
'playUrl' in o ||
|
||||||
|
'liveUrl' in o ||
|
||||||
|
'streamUrl' in o ||
|
||||||
'mp4' in o ||
|
'mp4' in o ||
|
||||||
'm3u8' in o ||
|
'm3u8' in o ||
|
||||||
'flv' in o ||
|
'flv' in o ||
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user