tinymce.Env

This class contains various environment constants like browser versions etc. Normally you don’t want to sniff specific browser versions but sometimes you have to when it’s impossible to feature detect. So use this with care.

Summary

Properties

Name Type Summary Defined by

android

Boolean

Constant that is true if the operating system is android.

Deprecated in TinyMCE 5.1 and has been marked for removal in TinyMCE 6.0 - Use os.isAndroid() instead.

Env

browser.current

String

Returns the current browser name.

Added in TinyMCE 5.1

Env

browser.version

Object

Returns the current browser major and minor version.

Added in TinyMCE 5.1

Env

caretAfter

Boolean

Returns true/false if the browser can or can’t place the caret after a inline block like an image.

Deprecated in TinyMCE 5.1 and has been marked for removal in TinyMCE 6.0 - All supported browsers now support placing carets after inline blocks.

Env

ceFalse

Boolean

Constant that is true if the browser supports contentEditable=false regions.

Deprecated in TinyMCE 5.1 and has been marked for removal in TinyMCE 6.0 - All supported browsers now support contentEditable=false regions.

Env

contentEditable

Boolean

Constant that is true if the browser supports editing.

Deprecated in TinyMCE 5.1 and has been marked for removal in TinyMCE 6.0 - All supported browsers now support content editable elements.

Env

desktop

Boolean

Deprecated in TinyMCE 5.1 and has been marked for removal in TinyMCE 6.0 - Use deviceType.isDesktop() instead.

Env

documentMode

Number

Returns the IE document mode. For non IE browsers, this will fake IE 10 document mode.

Env

experimentalShadowDom

Boolean

Deprecated in TinyMCE 5.5 and has been marked for removal in TinyMCE 6.0 - if you need the original target of an event, please use event.composedPath().

Env

fileApi

Boolean

Constant that is true if the browser has a modern file API.

Deprecated in TinyMCE 5.10 and has been marked for removal in TinyMCE 6.0 - All supported browsers now support modern file APIs.

Env

gecko

Boolean

Constant that is true if the browser is Gecko.

Deprecated in TinyMCE 5.1 and has been marked for removal in TinyMCE 6.0 - Use browser.isFirefox() instead.

Env

iOS

Boolean

Constant that is true if the operating system is iOS.

Deprecated in TinyMCE 5.1 and has been marked for removal in TinyMCE 6.0 - Use os.isiOS() instead.

Env

ie

Number

Constant that is greater than zero if the browser is IE.

Deprecated in TinyMCE 5.1 and has been marked for removal in TinyMCE 6.0 - Use browser.version.major and browser.isIE() or browser.isEdge() instead.

Env

mac

Boolean

Constant that is true if the operating system is Mac OS.

Deprecated in TinyMCE 5.1 and has been marked for removal in TinyMCE 6.0 - Use os.isOSX() or os.isiOS() instead.

Env

opera

Boolean

Constant that is true if the browser is Opera.

Deprecated in TinyMCE 5.1 and has been marked for removal in TinyMCE 6.0 - Use browser.isOpera() instead.

Env

os.current

String

Returns the current operating system name.

Added in TinyMCE 5.1

Env

os.version

Object

Returns the current operating system major and minor version.

Added in TinyMCE 5.1

Env

range

Boolean

Constant that is true if the browser supports native DOM Ranges. IE 9+.

Deprecated in TinyMCE 5.1 and has been marked for removal in TinyMCE 6.0 - All supported browsers now support native DOM ranges.

Env

transparentSrc

Boolean

Transparent image data url.

Env

webKit

Boolean

Constant that is true if the browser is WebKit (Safari/Chrome).

Deprecated in TinyMCE 5.1 and has been marked for removal in TinyMCE 6.0 - Use browser.isSafari() or browser.isChrome() instead.

Env

Methods

Name Summary Defined by

browser.isChrome()

Returns true if the user’s browser is Google Chrome.

Added in TinyMCE 5.1

Env

browser.isEdge()

Returns true if the user’s browser is Microsoft Edge.

Added in TinyMCE 5.1

Env

browser.isFirefox()

Returns true if the user’s browser is Firefox.

Added in TinyMCE 5.1

Env

browser.isIE()

Returns true if the user’s browser is Microsoft Internet Explorer.

Added in TinyMCE 5.1

Env

browser.isOpera()

Returns true if the user’s browser is Opera.

Added in TinyMCE 5.1

Env

browser.isSafari()

Returns true if the user’s browser is Safari.

Added in TinyMCE 5.1

Env

deviceType.isDesktop()

Returns true if the user’s device is a desktop device.

Added in TinyMCE 5.1

Env

deviceType.isPhone()

Returns true if the user’s device is a phone.

Added in TinyMCE 5.1

Env

deviceType.isTablet()

Returns true if the user’s device is a tablet.

Added in TinyMCE 5.1

Env

deviceType.isTouch()

Returns true if the user’s device is a touch device.

Added in TinyMCE 5.1

Env

deviceType.isWebView()

Returns true if the user’s device is a WebView device.

Added in TinyMCE 5.1

Env

deviceType.isiPad()

Returns true if the user’s device is an iPad.

Added in TinyMCE 5.1

Env

deviceType.isiPhone()

Returns true if the user’s device is an iPhone.

Added in TinyMCE 5.1

Env

os.isAndroid()

Returns true if the user’s operating system is Android.

Added in TinyMCE 5.1

Env

os.isChromeOS()

Returns true if the user’s operating system is ChromeOS.

Added in TinyMCE 5.1

Env

os.isFreeBSD()

Returns true if the user’s operating system is FreeBSD.

Added in TinyMCE 5.1

Env

os.isLinux()

Returns true if the user’s operating system is Linux.

Added in TinyMCE 5.1

Env

os.isOSX()

Returns true if the user’s operating system is Mac OS X.

Added in TinyMCE 5.1

Env

os.isSolaris()

Returns true if the user’s operating system is Solaris.

Added in TinyMCE 5.1

Env

os.isWindows()

Returns true if the user’s operating system is Microsoft Windows.

Added in TinyMCE 5.1

Env

os.isiOS()

Returns true if the user’s operating system is iOS.

Added in TinyMCE 5.1

Env

Methods

browser.isChrome()

browser.isChrome(): Boolean

Returns true if the user’s browser is Google Chrome.

Added in TinyMCE 5.1

Return value

  • Boolean - Returns true if the user’s browser is Google Chrome.


browser.isEdge()

browser.isEdge(): Boolean

Returns true if the user’s browser is Microsoft Edge.

Added in TinyMCE 5.1

Return value

  • Boolean - Returns true if the user’s browser is Microsoft Edge.


browser.isFirefox()

browser.isFirefox(): Boolean

Returns true if the user’s browser is Firefox.

Added in TinyMCE 5.1

Return value

  • Boolean - Returns true if the user’s browser is Firefox.


browser.isIE()

browser.isIE(): Boolean

Returns true if the user’s browser is Microsoft Internet Explorer.

Added in TinyMCE 5.1

Return value

  • Boolean - Returns true if the user’s browser is Microsoft Internet Explorer.


browser.isOpera()

browser.isOpera(): Boolean

Returns true if the user’s browser is Opera.

Added in TinyMCE 5.1

Return value

  • Boolean - Returns true if the user’s browser is Opera.


browser.isSafari()

browser.isSafari(): Boolean

Returns true if the user’s browser is Safari.

Added in TinyMCE 5.1

Return value

  • Boolean - Returns true if the user’s browser is Safari.


deviceType.isDesktop()

deviceType.isDesktop(): Boolean

Returns true if the user’s device is a desktop device.

Added in TinyMCE 5.1

Return value

  • Boolean - Returns true if the user’s device is a desktop device.


deviceType.isPhone()

deviceType.isPhone(): Boolean

Returns true if the user’s device is a phone.

Added in TinyMCE 5.1

Return value

  • Boolean - Returns true if the user’s device is a phone.


deviceType.isTablet()

deviceType.isTablet(): Boolean

Returns true if the user’s device is a tablet.

Added in TinyMCE 5.1

Return value

  • Boolean - Returns true if the user’s device is a tablet.


deviceType.isTouch()

deviceType.isTouch(): Boolean

Returns true if the user’s device is a touch device.

Added in TinyMCE 5.1

Return value

  • Boolean - Returns true if the user’s device is a touch device.


deviceType.isWebView()

deviceType.isWebView(): Boolean

Returns true if the user’s device is a WebView device.

Added in TinyMCE 5.1

Return value

  • Boolean - Returns true if the user’s device is a WebView device.


deviceType.isiPad()

deviceType.isiPad(): Boolean

Returns true if the user’s device is an iPad.

Added in TinyMCE 5.1

Return value

  • Boolean - Returns true if the user’s device is an iPad.


deviceType.isiPhone()

deviceType.isiPhone(): Boolean

Returns true if the user’s device is an iPhone.

Added in TinyMCE 5.1

Return value

  • Boolean - Returns true if the user’s device is an iPhone.


os.isAndroid()

os.isAndroid(): Boolean

Returns true if the user’s operating system is Android.

Added in TinyMCE 5.1

Return value

  • Boolean - Returns true if the user’s operating system is Android.


os.isChromeOS()

os.isChromeOS(): Boolean

Returns true if the user’s operating system is ChromeOS.

Added in TinyMCE 5.1

Return value

  • Boolean - Returns true if the user’s operating system is ChromeOS.


os.isFreeBSD()

os.isFreeBSD(): Boolean

Returns true if the user’s operating system is FreeBSD.

Added in TinyMCE 5.1

Return value

  • Boolean - Returns true if the user’s operating system is FreeBSD.


os.isLinux()

os.isLinux(): Boolean

Returns true if the user’s operating system is Linux.

Added in TinyMCE 5.1

Return value

  • Boolean - Returns true if the user’s operating system is Linux.


os.isOSX()

os.isOSX(): Boolean

Returns true if the user’s operating system is Mac OS X.

Added in TinyMCE 5.1

Return value

  • Boolean - Returns true if the user’s operating system is Mac OS X.


os.isSolaris()

os.isSolaris(): Boolean

Returns true if the user’s operating system is Solaris.

Added in TinyMCE 5.1

Return value

  • Boolean - Returns true if the user’s operating system is Solaris.


os.isWindows()

os.isWindows(): Boolean

Returns true if the user’s operating system is Microsoft Windows.

Added in TinyMCE 5.1

Return value

  • Boolean - Returns true if the user’s operating system is Microsoft Windows.


os.isiOS()

os.isiOS(): Boolean

Returns true if the user’s operating system is iOS.

Added in TinyMCE 5.1

Return value

  • Boolean - Returns true if the user’s operating system is iOS.