Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Browser type errors #17815

Open
longchuan opened this issue Nov 5, 2024 · 3 comments
Open

Browser type errors #17815

longchuan opened this issue Nov 5, 2024 · 3 comments
Assignees
Labels
Bug Needs Triage Needs to be assigned by the team

Comments

@longchuan
Copy link
Contributor

longchuan commented Nov 5, 2024

Cocos Creator version

3.8.4

System information

windows 11,edge

Issue description

image
image
The useragent of windows edge.And there were many errors in mobile too.
And the Huawei Browser will not be exec because of the toLowerCase

Relevant error log output

No response

Steps to reproduce

console.log(sys.browserType);
console.log(sys.browserVersion);
console.log(navigator.userAgent);

Minimal reproduction project

No response

@longchuan longchuan added Bug Needs Triage Needs to be assigned by the team labels Nov 5, 2024
@longchuan
Copy link
Contributor Author

longchuan commented Nov 5, 2024

Perhaps,slice the useragent to 1/2,and exec the "edg" will be more faster.
Maybe,the old edge's useragent was "edge"
Perhaps,cocos engine should let developers to select the supported browser.

@longchuan
Copy link
Contributor Author

longchuan commented Nov 5, 2024

And,cancel the method of "toLowerCase",that will be more faster.The useragent will not be change in a long time.

@longchuan
Copy link
Contributor Author

longchuan commented Nov 5, 2024

Perhaps,slice the useragent to 1/2,and exec the "edg" will be more faster.

such as:

if(useragent.length>12){
     useragent = useragent.slice(useragent.length/2,useragent.length);
}

calculate the time of "if" and the time of slice,this will solve many problems about what causes project a slow one.
and put the more time used part to init.
For the end,let developers to load them in init.
Cocos' init was not necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Needs Triage Needs to be assigned by the team
Projects
None yet
Development

No branches or pull requests

2 participants