lib/mobileesp.rb
# The quick way to detect for a mobile device.
#  Will probably detect most recent/current mid-tier Feature Phones
#  as well as smartphone-class devices. Excludes Apple iPads.
The quick way to detect for a mobile device.
Will probably detect most recent/current mid-tier Feature Phones
as well as smartphone-class devices. Excludes Apple iPads.
The quick way to detect for a mobile device . Will probably detect most recent / current mid - tier Feature Phones as well as smartphone - class devices . Excludes Apple iPads .
def detect_mobile_quick
      return false if detect_ipad
      ( detect_smartphone ||
        detect_wap_wml ||
        detect_brew_device ||
        detect_opera_mobile ||
        !@user_agent.index(ENGINE_NETFRONT).nil? ||
        !@user_agent.index(ENGINE_UP_BROWSER).nil? ||
        !@user_agent.index(ENGINE_OPEN_WEB).nil? ||
        detect_danger_hiptop ||
        detect_midp_capable ||
        detect_maemo_tablet ||
        detect_archos ||
        (!@user_agent.index(DEVICE_PDA).nil? && @user_agent.index(Ddetect_UPDATE).nil?) || 
        !@user_agent.index(MOBILE).nil? )
    end
def detect_mobile_quick return false if detect_ipad ( detect_smartphone || detect_wap_wml || detect_brew_device || detect_opera_mobile || ! @user_agent . index ( ENGINE_NETFRONT ) . nil? || ! @user_agent . index ( ENGINE_UP_BROWSER ) . nil? || ! @user_agent . index ( ENGINE_OPEN_WEB ) . nil? || detect_danger_hiptop || detect_midp_capable || detect_maemo_tablet || detect_archos || ( ! @user_agent . index ( DEVICE_PDA ) . nil? && @user_agent . index ( Ddetect_UPDATE ) . nil? ) || ! @user_agent . index ( MOBILE ) . nil? ) end
The quick way to detect for a mobile device.
The quick way to detect for a mobile device .
# Let's say no if it's an iPad, which contains 'mobile' in its user agent # no index found