package jp.dip.arimodoki.common;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
@Scope("prototype")
@Component
public class CheckBrowser implements CConst, CheckBrowserIf {
private int browserType = BROWSER_IE;
public CheckBrowser() {}
public int getBrowser(String useragent) {
if(useragent.indexOf(BROWSER_STR_IE)>=0) {
this.browserType = BROWSER_IE;
} else if(useragent.indexOf(BROWSER_STR_EDGE)>=0) {
this.browserType = BROWSER_EDGE;
} else if(useragent.indexOf(BROWSER_STR_OPERA)>=0) {
this.browserType = BROWSER_OPERA;
} else if(useragent.indexOf(BROWSER_STR_LUNA)>=0) {
this.browserType = BROWSER_LUNA;
} else if(useragent.indexOf(BROWSER_STR_SLE)>=0) {
this.browserType = BROWSER_SLE;
} else if(useragent.indexOf(BROWSER_STR_FF)>=0) {
this.browserType = BROWSER_FF;
} else if(useragent.indexOf(BROWSER_STR_CHROME)>=0) {
this.browserType = BROWSER_CHROME;
} else if(useragent.indexOf(BROWSER_STR_SAFARI)>=0) {
this.browserType = BROWSER_SAFARI;
}
return this.browserType;
}
}
|