CKEDITOR.env
Environment and browser information.
Filtering
Properties
-
air : Boolean
CKEDITOR.env#air
Indicates that CKEditor is running in Adobe AIR.
if ( CKEDITOR.env.air ) alert( 'I\'m on AIR!' );
-
chrome : Boolean
CKEDITOR.env#chrome
Indicates that CKEditor is running in a Blink-based browser like Chrome.
if ( CKEDITOR.env.chrome ) alert( 'I\'m running in Chrome!' );
-
cssClass : String
CKEDITOR.env#cssClass
A CSS class that denotes the browser where CKEditor runs and is appended to the HTML element that contains the editor. It makes it easier to apply browser-specific styles to editor instances.
myDiv.className = CKEDITOR.env.cssClass;
-
Indicates that CKEditor is running in Microsoft Edge.
if ( CKEDITOR.env.edge ) alert( 'I\'m running in Edge!' );
See also ie.
-
gecko : Boolean
CKEDITOR.env#gecko
Indicates that CKEditor is running in a Gecko-based browser, like Firefox.
if ( CKEDITOR.env.gecko ) alert( 'I\'m riding a gecko!' );
-
hc : Boolean
CKEDITOR.env#hc
Indicates that CKEditor is running on a High Contrast environment.
if ( CKEDITOR.env.hc ) alert( 'You\'re running on High Contrast mode. The editor interface will get adapted to provide you a better experience.' );
-
hidpi : Boolean
CKEDITOR.env#hidpi
Indicates that CKEditor is running in the HiDPI environment.
if ( CKEDITOR.env.hidpi ) alert( 'You are using a screen with high pixel density.' );
-
iOS : Boolean
CKEDITOR.env#iOS
Indicates that CKEditor is running on Apple iPhone/iPad/iPod devices.
if ( CKEDITOR.env.iOS ) alert( 'I like little apples!' );
-
ie : Boolean
CKEDITOR.env#ie
Indicates that CKEditor is running in Internet Explorer.
if ( CKEDITOR.env.ie ) alert( 'I\'m running in IE!' );
Note: This property is also set to
true
if CKEditor is running in Microsoft Edge. -
Indicates that CKEditor is running in an IE6-like environment, which includes IE6 itself as well as IE7, IE8 and IE9 in Quirks Mode.
-
Indicates that CKEditor is running in an IE7-like environment, which includes IE7 itself and IE8's IE7 Document Mode.
-
Indicates that CKEditor is running in Internet Explorer 8 on Standards Mode.
-
Indicates that CKEditor is running in Internet Explorer 9 on Standards Mode.
-
isCompatible : Boolean
CKEDITOR.env#isCompatible
Since CKEditor 4.5.0 this property is a blacklist of browsers incompatible with CKEditor. It means that it is set to
false
only in browsers that are known to be incompatible. Before CKEditor 4.5.0 this property was a whitelist of browsers that were known to be compatible with CKEditor.The reason for this change is the rising fragmentation of the browser market (especially the mobile segment). It became too complicated to check in which new environments CKEditor is going to work.
In order to enable CKEditor 4.4.x and below in unsupported environments see the Enabling CKEditor in Unsupported Environments article.
if ( CKEDITOR.env.isCompatible ) alert( 'Your browser is not known to be incompatible with CKEditor!' );
-
mac : Boolean
CKEDITOR.env#mac
Indicates that CKEditor is running on Macintosh.
if ( CKEDITOR.env.mac ) alert( 'I love apples!'' );
-
Indicates that CKEditor is running in a mobile environemnt.
if ( CKEDITOR.env.mobile ) alert( 'I\'m running with CKEditor today!' );
-
Indicates that CKEditor is running in a browser which uses a bogus
<br>
filler in order to correctly display caret in empty blocks. -
Indicates that CKEditor is running in a browser which needs a non-breaking space filler in order to correctly display caret in empty blocks.
-
quirks : Boolean
CKEDITOR.env#quirks
Indicates that CKEditor is running in a Quirks Mode environment.
if ( CKEDITOR.env.quirks ) alert( 'Nooooo!' );
Internet Explorer 10 introduced the New Quirks Mode, which is similar to the Quirks Mode implemented in other modern browsers and defined in the HTML5 specification. It can be handled as the Standards mode, so the value of this property will be set to
false
.The Internet Explorer 5 Quirks mode which is still available in Internet Explorer 10+ sets this value to
true
and version to7
.Read more: IEBlog
-
safari : Boolean
CKEDITOR.env#safari
Indicates that CKEditor is running in Safari (including the mobile version).
if ( CKEDITOR.env.safari ) alert( 'I\'m on Safari!' );
-
version : Number
CKEDITOR.env#version
Contains the browser version.
For Gecko-based browsers (like Firefox) it contains the revision number with first three parts concatenated with a padding zero (e.g. for revision 1.9.0.2 we have 10900).
For WebKit-based browsers (like Safari and Chrome) it contains the WebKit build version (e.g. 522).
For IE browsers, it matches the "Document Mode".
if ( CKEDITOR.env.ie && CKEDITOR.env.version <= 6 ) alert( 'Ouch!' );
-
webkit : Boolean
CKEDITOR.env#webkit
Indicates that CKEditor is running in a WebKit-based browser, like Safari, or Blink-based browser, like Chrome.
if ( CKEDITOR.env.webkit ) alert( 'I\'m running in a WebKit browser!' );
Methods
-
Indicates that the browser has a custom domain enabled. This has been set with
document.domain
.if ( CKEDITOR.env.isCustomDomain() ) alert( 'I\'m in a custom domain!' );
Returns
Boolean
true
if a custom domain is enabled.
-
secure() → Boolean
CKEDITOR.env#secure
Indicates that the page is running under an encrypted connection.
if ( CKEDITOR.env.secure ) alert( 'I\'m on SSL!' );
Returns
Boolean
true
if the page has an encrypted connection.