Closed hikaMaeng closed 3 years ago
Hi @hikaMaeng!
Currently we are offering webview
property for inApp browser detection.
Do you need to detect those in-app browsers seperatly?
If you do, let me know by adding comments here.
@happyhj
webview
property have to give more option than now.
for example, there is a case for applying other function based on in-app browser version like hotfix.
I think it's better eg.Agent give option like plugin to parsing in-app browser version.
when I developing an application on WebView, I temporarily handled app bug in web. At that time, I had experience developing separated features based on in-app versions.
My Offer is something like
switch(eg.agent().browser.name){
case 'naver_inapp_android':
case 'cacaotalk_inapp_android':
case 'facebook_inapp_android':
...
}
and 3rd party plugin system for additional detection of browser or os or isMobile
eg.agent()
.extendOS({
criteria: /customOS/,
identity: "customOS"
})
.extendBrowser({
criteria:/sony /,
identity:"sony"
});
@vreality64 I agree with the requirement to provide the app name and version.
@hikaMaeng Your '3rd party plugin system' looks awesome. This allows you to extend the agent module without modifying the library source.
I will develop both soon.
Will support the following mobile apps with the bundled parsing rule. It is selected according to the number of users.
The new API will be look like below. And also backward compatibility will be guaranteed.
// Current Usage
eg.agent(); // -> agentInfo from navigate.userAgent
eg.agent(ua) // -> agentInfo from ua
// Extended Usage
const extendedParseRules = {
os: [{
criteria: /(myownos)\/([\w\.]+)/i, // <-- optional
identity: "my own os",
versionSearch : "os version" // <-- optional
}], browser: [{
criteria: /(myownbrowser)\/([\w\.]+)/i, // <-- optional
identity: "my own browser",
versionSearch : "browser version" // <-- optional
}]
};
cosnt myAgent = new eg.agent(extendedParseRules) // this will custom agent function
myAgent() // -> agentInfo from navigate.userAgent
var uaString = 'Mozilla/5.0 myownbrowser/1.3';
myAgent(ua) // -> agentInfo from uaString
look so good! thanx f rapid feedback!!
In Ios, inappbrowser creates iframe. So you can check that if there is an iframe created in your html that means it is an inappbrowser otherwise its a regular mobile browser.
if(document.getElementById("_cdvIframeBridge")){ alert('its an inappbrowser')}else{ alert('its a mobile browser') }
This issue/PR has been automatically marked as stale because it has not had any update (including commits, comments, labels, milestones, etc) for 30 days. It will be closed automatically if no further update occurs in 7 day. Thank you for your contributions! 한글
이 이슈/PR은 commits, comments, labels, milestones 등 30일간 활동이 없어 자동으로 stale 상태로 전환되었습니다. 이후 7일간 활동이 없다면 자동으로 닫힐 예정입니다. 프로젝트 개선에 기여해주셔서 감사합니다.
Need additional detecting of popular in-app browsers