public class ERXBasicBrowser extends ERXBrowser
ERXBasicBrowser
is a concrete subclass of ERXBrowser
that defines browser object. A browser object represents the web browser
that the current request-response cycle is dealing with. It holds the
information retrieved from HTTP request's "user-agent"
header, and such information includes web browser's name, version, Mozilla
compatible version and platform (OS). Also, a browser object can answer
boolean questions such as isIE()
, isOmniWeb()
,
isVersion5()
and isMozilla40Compatible()
, and even more
specific questions like isIFrameSupported()
and
willRenderNestedTablesFast()
.
ERXBasicBrowser
is immutable and shared by different sessions
and direct actions. The shared instances are managed by
ERXBrowserFactory
which is also responsible to parse "user-agent"
header in a WORequest
object and
to get an appropriate browser object.
You can extends ERXBasicBrowser
or its abstract parent ERXBrowser
to implement more specific questions for your application. One potential
example will be to have a question isSupportedBrowser
that
checks if the client is using one of the supported browsers for your
application.
ERXSession
holds a browser object that represent the web browser for
that session and browser()
method returns the
object.
To access ERXBasicBrowser
's boolean questions from WOConditionals
on a web component, set the key path like "session.brower.isNetscape"
to their condition bindings.
ERXDirectAction
also holds a browser object for the current request.
Use its browser()
method to access the
object from a session-less direct action.
IE 5.17 OS 9
user-agent = (Mozilla/4.0 (compatible; MSIE 5.17; Mac_PowerPC)); ua-os = (MacOS); ua-cpu = (PPC);
IE 5.0 OS 9: user-agent = (Mozilla/4.0 (compatible; MSIE 5.0; Mac_PowerPC));
ua-os = (MacOS); ua-cpu = (PPC);
FireFox OS X 10.3.3
user-agent = (Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.6) Gecko/20040206 Firefox/0.8);
IE 5.2 MacOS X
user-agent = (Mozilla/4.0 (compatible; MSIE 5.23; Mac_PowerPC)); ua-os = (MacOS); ua-cpu = (PPC);
Safari
user-agent = ("Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-us) AppleWebKit/124 (KHTML, like Gecko) Safari/125.1");
IE WIndows 6.02
user-agent = (Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0));
ERXBasicBrowser
はブラウザ・オブジェクトを定義する ERXBrowser
の明確なサブクラスです。
ブラウザ・オブジェクトはカレント・リクエスト・レスポンス・ループの Webブラウザを表します。
HTTP リクエスト・ヘッダー "user-agent"
の情報を保持し、さらに
Webブラウザ名、プラットフォームや Mozilla互換性の情報を含みます。
ブラウザ・オブジェクトは基本なメソッド isIE
や isVersion5
のみではなく、
もっと確実な isIFrameSupported
と willRenderNestedTablesFast
を boolean で
回答します。isSupportedBrowser
を追加できます。browser
メソッドでオブジェクトを取得できます。browser
メソッドを使用します。IE 5.17 OS 9:
user-agent = (Mozilla/4.0 (compatible; MSIE 5.17; Mac_PowerPC)); ua-os = (MacOS); ua-cpu = (PPC);
IE 5.0 OS 9: user-agent = (Mozilla/4.0 (compatible; MSIE 5.0; Mac_PowerPC));
ua-os = (MacOS); ua-cpu = (PPC);
FireFox OS X 10.3.3:
user-agent = (Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.6) Gecko/20040206 Firefox/0.8);
IE 5.2 MacOS X:
user-agent = (Mozilla/4.0 (compatible; MSIE 5.23; Mac_PowerPC)); ua-os = (MacOS); ua-cpu = (PPC);
Safari:
user-agent = ("Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-us) AppleWebKit/124 (KHTML, like Gecko) Safari/125.1");
IE WIndows 6.02:
user-agent = (Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0));
Chrome Android:
user-agent = Mozilla/5.0 (Linux; Android 8.0.0; moto g(6)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.80 Mobile Safari/537.36
com.webobjects.foundation.NSKeyValueCoding._BooleanFieldBinding, com.webobjects.foundation.NSKeyValueCoding._BooleanMethodBinding, com.webobjects.foundation.NSKeyValueCoding._FieldBinding, com.webobjects.foundation.NSKeyValueCoding._ForwardingBinding, com.webobjects.foundation.NSKeyValueCoding._KeyBinding, com.webobjects.foundation.NSKeyValueCoding._KeyBindingCreation, com.webobjects.foundation.NSKeyValueCoding._MethodBinding, com.webobjects.foundation.NSKeyValueCoding._NumberFieldBinding, com.webobjects.foundation.NSKeyValueCoding._NumberMethodBinding, com.webobjects.foundation.NSKeyValueCoding._ReflectionKeyBindingCreation, com.webobjects.foundation.NSKeyValueCoding.DefaultImplementation, com.webobjects.foundation.NSKeyValueCoding.ErrorHandling, com.webobjects.foundation.NSKeyValueCoding.MapImplementation, com.webobjects.foundation.NSKeyValueCoding.Null<T>, com.webobjects.foundation.NSKeyValueCoding.UnknownKeyException, com.webobjects.foundation.NSKeyValueCoding.Utility, com.webobjects.foundation.NSKeyValueCoding.ValueAccessor
ANDROID, CHROME, EDGE, FIREFOX, ICAB, IE, IPAD, IPHONE, LINUX, MACOS, MOZILLA, NETSCAPE, NO_GECKO, OMNIWEB, OPERA, POWER_PC, ROBOT, SAFARI, UNKNOWN_BROWSER, UNKNOWN_CPU, UNKNOWN_PLATFORM, UNKNOWN_VERSION, WINDOWS
Constructor and Description |
---|
ERXBasicBrowser(String browserName,
String version,
String mozillaVersion,
String platform,
NSDictionary userInfo) |
Modifier and Type | Method and Description |
---|---|
String |
browserName()
Browser name string
ブラウザ名を戻します
|
String |
cpu()
CPU string
ブラウザが動作している CPU を戻します
|
String |
geckoRevision()
Returns the gecko revision of the browser or
ERXBrowser.NO_GECKO . |
boolean |
isAndroid() |
boolean |
isChrome()
Browser is Chrome?
ブラウザは Chrome ですか?
|
boolean |
isEdge()
Browser is Microsoft Edge?
ブラウザは Microsoft Edge ですか?
|
boolean |
isFirefox()
Browser is Firefox?
ブラウザは Firefox ですか?
|
boolean |
isICab()
Browser is iCab?
ブラウザは iCab ですか?
|
boolean |
isIE()
Browser is Internet Explorer?
ブラウザは Internet Explorer ですか?
|
boolean |
isIFrameSupported()
Does the browser support IFrames?
ブラウザが iFrames をサポートしていますか?
|
boolean |
isIPad() |
boolean |
isIPhone() |
boolean |
isJavaScriptOnImageButtonSupported()
Javascript OnImage ボタンがサポートされていますか?
|
boolean |
isLinux() |
boolean |
isMacOS() |
boolean |
isMozilla()
Mozilla ですか?
|
boolean |
isMozilla40Compatible() |
boolean |
isMozilla45Compatible() |
boolean |
isMozilla50Compatible() |
boolean |
isNetscape()
Browser is Netscape?
ブラウザは Netscape ですか?
|
boolean |
isNotNetscape()
Browser is not Netscape?
ブラウザは Netscape ではないか?
|
boolean |
isOmniWeb()
Browser is OmniWeb?
ブラウザは OmniWeb ですか?
|
boolean |
isOpera()
Browser is Opera?
ブラウザは Opera ですか?
|
boolean |
isRobot()
Browser is isRobot?
ブラウザはロボットですか?
|
boolean |
isSafari()
Browser is Safari?
ブラウザは Safari ですか?
|
boolean |
isUnknownBrowser()
未知のブラウザ?
|
boolean |
isUnknownPlatform() |
boolean |
isVersion2() |
boolean |
isVersion3() |
boolean |
isVersion4() |
boolean |
isVersion40() |
boolean |
isVersion41() |
boolean |
isVersion45() |
boolean |
isVersion5() |
boolean |
isVersion51() |
boolean |
isVersion6() |
boolean |
isVersion7() |
boolean |
isVersion8() |
boolean |
isVersion9() |
boolean |
isWindows() |
Integer |
majorVersion()
Major version
|
String |
mozillaVersion()
MozillaVersion string
ブラウザの Mozilla バージョンを戻します
|
String |
platform()
Platform string
プラットフォームを戻します
|
NSDictionary |
userInfo()
UserInfo dictionary
UserInfo ディクショナリーを戻します
|
String |
version()
Version string
ブラウザのバージョンアップを戻します
|
boolean |
willRenderNestedTablesFast()
Browser is not netscape or is a version 5 browser.
|
formValueEncoding, messageEncodingForLanguage, messageEncodingForLanguages, messageEncodingForRequest, takeValueForKey, toString, valueForKey
public ERXBasicBrowser(String browserName, String version, String mozillaVersion, String platform, NSDictionary userInfo)
public String browserName()
ERXBrowser
browserName
in class ERXBrowser
public String version()
ERXBrowser
version
in class ERXBrowser
public Integer majorVersion()
ERXBrowser
majorVersion
in class ERXBrowser
public String mozillaVersion()
ERXBrowser
mozillaVersion
in class ERXBrowser
public String platform()
ERXBrowser
platform
in class ERXBrowser
public String cpu()
public NSDictionary userInfo()
ERXBrowser
userInfo
in class ERXBrowser
public boolean isUnknownBrowser()
ERXBrowser
isUnknownBrowser
in class ERXBrowser
public boolean isRobot()
ERXBrowser
isRobot
in class ERXBrowser
public boolean isICab()
ERXBrowser
isICab
in class ERXBrowser
public boolean isEdge()
ERXBrowser
isEdge
in class ERXBrowser
public boolean isIE()
ERXBrowser
isIE
in class ERXBrowser
public boolean isNetscape()
ERXBrowser
isNetscape
in class ERXBrowser
public boolean isNotNetscape()
ERXBrowser
isNotNetscape
in class ERXBrowser
public boolean isOmniWeb()
ERXBrowser
isOmniWeb
in class ERXBrowser
public boolean isOpera()
ERXBrowser
isOpera
in class ERXBrowser
public boolean isSafari()
ERXBrowser
isSafari
in class ERXBrowser
public boolean isFirefox()
ERXBrowser
isFirefox
in class ERXBrowser
public boolean isChrome()
ERXBrowser
isChrome
in class ERXBrowser
public boolean isMozilla()
public boolean isMozilla50Compatible()
isMozilla50Compatible
in class ERXBrowser
public boolean isMozilla45Compatible()
isMozilla45Compatible
in class ERXBrowser
public boolean isMozilla40Compatible()
isMozilla40Compatible
in class ERXBrowser
public boolean isVersion9()
isVersion9
in class ERXBrowser
public boolean isVersion8()
isVersion8
in class ERXBrowser
public boolean isVersion7()
isVersion7
in class ERXBrowser
public boolean isVersion6()
isVersion6
in class ERXBrowser
public boolean isVersion5()
isVersion5
in class ERXBrowser
public boolean isVersion51()
isVersion51
in class ERXBrowser
public boolean isVersion45()
isVersion45
in class ERXBrowser
public boolean isVersion41()
isVersion41
in class ERXBrowser
public boolean isVersion40()
isVersion40
in class ERXBrowser
public boolean isVersion4()
isVersion4
in class ERXBrowser
public boolean isVersion3()
isVersion3
in class ERXBrowser
public boolean isVersion2()
isVersion2
in class ERXBrowser
public boolean isUnknownPlatform()
isUnknownPlatform
in class ERXBrowser
public boolean isMacOS()
isMacOS
in class ERXBrowser
public boolean isWindows()
isWindows
in class ERXBrowser
public boolean isLinux()
isLinux
in class ERXBrowser
public boolean isAndroid()
isAndroid
in class ERXBrowser
public boolean isIPhone()
isIPhone
in class ERXBrowser
public boolean isIPad()
isIPad
in class ERXBrowser
public String geckoRevision()
ERXBrowser.NO_GECKO
.geckoRevision
in class ERXBrowser
ERXBrowser.NO_GECKO
.public boolean isIFrameSupported()
public boolean willRenderNestedTablesFast()
public boolean isJavaScriptOnImageButtonSupported()
Copyright © 2002 – 2020 Project Wonder.