abstract class Browser::Base

Included Modules

Direct Known Subclasses

Defined in:

browser/base.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(ua : String, accept_language = nil) #

[View source]

Instance Method Detail

def accept_language : Array(AcceptLanguage) #

Return an array with all preferred languages that this browser accepts.


[View source]
def adobe_air? #

[View source]
def alipay?(expected_version = nil) #

[View source]
def android? #

[View source]
def blackberry? #

[View source]
def blackberry_playbook? #

[View source]
def bot #

Return the bot info.


[View source]
def bot? #

Detect if current user agent is from a bot.


[View source]
def chrome?(expected_version = nil) #

Detect if browser is Chrome.


[View source]
def chrome_os? #

[View source]
def compatibility_view? #

[View source]
def console? #

[View source]
def core_media?(expected_version = nil) #

Detect if browser is Apple CoreMedia.


[View source]
def device #

Return the device info.


[View source]
def duck_duck_go?(expected_version = nil) #

Detect if browser is DuckDuckGo.


[View source]
def edge?(expected_version = nil) #

Detect if browser is Microsoft Edge.


[View source]
def electron?(expected_version = nil) #

Detect if the browser is Electron.


[View source]
def facebook?(expected_version = nil) #

Detect if browser if Facebook.


[View source]
def firefox?(expected_version = nil) #

Detect if browser is Firefox.


[View source]
def firefox_os? #

[View source]
abstract def full_version : String #

[View source]
abstract def id : String #

[View source]
def ie?(expected_version = nil) #

Detect if browser is Microsoft Internet Explorer.


[View source]
def instagram?(expected_version = nil) #

Detect if browser is Instagram.


[View source]
def ios? #

[View source]
def ios_app? #

[View source]
def ios_webview? #

[View source]
def ipad? #

[View source]
def iphone? #

[View source]
def ipod_touch? #

[View source]
def kindle? #

[View source]
def kindle_fire? #

[View source]
def known? #

[View source]
def linux? #

[View source]
def mac? #

[View source]
abstract def match? : Bool #

[View source]
def meta #

Return a meta info about this browser.


[View source]
def micro_messenger?(expected_version = nil) #

Detect if browser is MicroMessenger.


[View source]
def mobile? #

[View source]
def msie_full_version #

[View source]
def msie_version #

[View source]
abstract def name : String #

[View source]
def nintendo? #

[View source]
def nintendo_switch? #

[View source]
def nintendo_wii? #

[View source]
def nintendo_wiiu? #

[View source]
def nokia?(expected_version = nil) #

Detect if browser is Nokia S40 Ovi Browser.


[View source]
def opera?(expected_version = nil) #

Detect if browser is Opera.


[View source]
def opera_mini?(expected_version = nil) #

Detect if browser is Opera Mini.


[View source]
def otter?(expected_version = nil) #

Detect if browser is Otter.


[View source]
def phantom_js?(expected_version = nil) #

Detect if browser is PhantomJS


[View source]
def platform #

Return the platform.


[View source]
def playbook? #

[View source]
def playstation3? #

[View source]
def playstation4? #

[View source]
def playstation? #

[View source]
def playstation_vita? #

[View source]
def proxy? #

Detect if browser is a proxy browser.


[View source]
def ps3? #

[View source]
def ps4? #

[View source]
def psp? #

[View source]
def psp_vita? #

[View source]
def quicktime?(expected_version = nil) #

Detect if browser is QuickTime


[View source]
def safari?(expected_version = nil) #

Detect if browser is Safari.


[View source]
def safari_webapp_mode? #

[View source]
def samsung_browser?(expected_version = nil) #

Detect if browser is Samsung.


[View source]
def silk? #

[View source]
def snapchat?(expected_version = nil) #

Detect if browser is Snapchat.


[View source]
def sputnik?(expected_version = nil) #

Detect if browser is Sputnik.


[View source]
def surface? #

[View source]
def tablet? #

[View source]
def to_a #

[View source]
def to_s #

Return meta representation as string.


[View source]
def tv? #

[View source]
def ua : String #

[View source]
def uc_browser?(expected_version = nil) #

Detect if browser is UCBrowser.


[View source]
def unknown? #

[View source]
def version #

[View source]
def vita? #

[View source]
def webkit?(expected_version = nil) #

Detect if browser is WebKit-based.


[View source]
def webkit_full_version #

[View source]
def wechat? #

Detect if browser is MicroMessenger.


[View source]
def weibo?(expected_version = nil) #

[View source]
def wii? #

[View source]
def wiiu? #

[View source]
def windows10? #

[View source]
def windows7? #

[View source]
def windows8? #

[View source]
def windows8_1? #

[View source]
def windows? #

[View source]
def windows_mobile? #

[View source]
def windows_phone? #

[View source]
def windows_rt? #

[View source]
def windows_touchscreen_desktop? #

[View source]
def windows_vista? #

[View source]
def windows_wow64? #

[View source]
def windows_x64? #

[View source]
def windows_x64_inclusive? #

[View source]
def windows_xp? #

[View source]
def xbox? #

[View source]
def xbox_360? #

[View source]
def xbox_one? #

[View source]
def yandex?(expected_version = nil) #

Detect if browser is Yandex.


[View source]
def yandex_browser? #

[View source]