Important changes to Tiny Cloud pricing > Find out more

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.

Properties

name type summary defined by
android Boolean Constant that is true if the operating system is android.
Deprecated in TinyMCE 5.1 - Use os.isAndroid() instead.
tinymce.Env
browser.current String Returns the current browser name.
Added in TinyMCE 5.1
tinymce.Env
browser.version Object Returns the current browser major and minor version.
Added in TinyMCE 5.1
tinymce.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 - All supported browsers now support placing carets after inline blocks.
tinymce.Env
ceFalse Boolean Constant that is true if the browser supports contentEditable=false regions.
Deprecated in TinyMCE 5.1 - All supported browsers now support contentEditable=false regions.
tinymce.Env
contentEditable Boolean Constant that is true if the browser supports editing.
Deprecated in TinyMCE 5.1 - All supported browsers now support content editable elements.
tinymce.Env
documentMode Number Returns the IE document mode. For non IE browsers, this will fake IE 10 document mode. tinymce.Env
fileApi Boolean Constant that is true if the browser has a modern file API. tinymce.Env
gecko Boolean Constant that is true if the browser is Gecko.
Deprecated in TinyMCE 5.1 - Use browser.isFirefox() instead.
tinymce.Env
iOS Boolean Constant that is true if the operating system is iOS.
Deprecated in TinyMCE 5.1 - Use os.isiOS() instead.
tinymce.Env
ie Number Constant that is greater than zero if the browser is IE.
Deprecated in TinyMCE 5.1 - Use browser.version.major and browser.isIE() or browser.isEdge() instead.
tinymce.Env
mac Boolean Constant that is true if the operating system is Mac OS.
Deprecated in TinyMCE 5.1 - Use os.isOSX() or os.isiOS() instead.
tinymce.Env
opera Boolean Constant that is true if the browser is Opera.
Deprecated in TinyMCE 5.1 - Use browser.isOpera() instead.
tinymce.Env
os.current String Returns the current operating system name.
Added in TinyMCE 5.1
tinymce.Env
os.version Object Returns the current operating system major and minor version.
Added in TinyMCE 5.1
tinymce.Env
range Boolean Constant that is true if the browser supports native DOM Ranges. IE 9+.
Deprecated in TinyMCE 5.1 - All supported browsers now support native DOM ranges.
tinymce.Env
transparentSrc Boolean Transparent image data url. tinymce.Env
webKit Boolean Constant that is true if the browser is WebKit (Safari/Chrome).
Deprecated in TinyMCE 5.1 - Use browser.isSafari() or browser.isChrome() instead.
tinymce.Env

Methods

name summary defined by
browser.isChrome() Returns true if the user's browser is Google Chrome.
Added in TinyMCE 5.1
tinymce.Env
browser.isEdge() Returns true if the user's browser is Microsoft Edge.
Added in TinyMCE 5.1
tinymce.Env
browser.isFirefox() Returns true if the user's browser is Firefox.
Added in TinyMCE 5.1
tinymce.Env
browser.isIE() Returns true if the user's browser is Microsoft Internet Explorer.
Added in TinyMCE 5.1
tinymce.Env
browser.isOpera() Returns true if the user's browser is Opera.
Added in TinyMCE 5.1
tinymce.Env
browser.isSafari() Returns true if the user's browser is Safari.
Added in TinyMCE 5.1
tinymce.Env
deviceType.isDesktop() Returns true if the user's device is a desktop device.
Added in TinyMCE 5.1
tinymce.Env
deviceType.isPhone() Returns true if the user's device is a phone.
Added in TinyMCE 5.1
tinymce.Env
deviceType.isTablet() Returns true if the user's device is a tablet.
Added in TinyMCE 5.1
tinymce.Env
deviceType.isTouch() Returns true if the user's device is a touch device.
Added in TinyMCE 5.1
tinymce.Env
deviceType.isWebView() Returns true if the user's device is a WebView device.
Added in TinyMCE 5.1
tinymce.Env
deviceType.isiPad() Returns true if the user's device is an iPad.
Added in TinyMCE 5.1
tinymce.Env
deviceType.isiPhone() Returns true if the user's device is an iPhone.
Added in TinyMCE 5.1
tinymce.Env
os.isAndroid() Returns true if the user's operating system is Android.
Added in TinyMCE 5.1
tinymce.Env
os.isFreeBSD() Returns true if the user's operating system is FreeBSD.
Added in TinyMCE 5.1
tinymce.Env
os.isLinux() Returns true if the user's operating system is Linux.
Added in TinyMCE 5.1
tinymce.Env
os.isOSX() Returns true if the user's operating system is Mac OS X.
Added in TinyMCE 5.1
tinymce.Env
os.isSolaris() Returns true if the user's operating system is Solaris.
Added in TinyMCE 5.1
tinymce.Env
os.isWindows() Returns true if the user's operating system is Microsoft Windows.
Added in TinyMCE 5.1
tinymce.Env
os.isiOS() Returns true if the user's operating system is iOS.
Added in TinyMCE 5.1
tinymce.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.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.

Can't find what you're looking for? Let us know.

Except as otherwise noted, the content of this page is licensed under the Creative Commons BY-NC-SA 3.0 License, and code samples are licensed under the Apache 2.0 License.