Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7405618
ve.init.SupportCheck.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
ve.init.SupportCheck.js
View Options
/*!
* VisualEditor initialization support checker.
*
* @copyright See AUTHORS.txt
*/
(
function
()
{
/**
* Check whether the environment has the needed features to load VisualEditor.
* This considers every ES5 feature, support for contentEditable itself, those
* specific DOM features we use, and SVG support for the user interface. As we
* use this to check for feature compatibility this file must be ES3-parsable.
*
* @method VisualEditorSupportCheck
* @memberof ve
* @return {boolean} True if the environment should support VisualEditor.
*/
window
.
VisualEditorSupportCheck
=
function
()
{
return
(
/* ES6 */
(
function
()
{
try
{
// eslint-disable-next-line no-new, no-new-func
new
Function
(
'(a = 0) => a'
);
return
true
;
}
catch
(
e
)
{
return
false
;
}
}()
)
&&
/* ES6 RegExp.prototype.flags */
/./g
.
flags
===
'g'
&&
// TODO: Most of the below checks can probably be removed as they are supported in all ES6 browsers.
/* contentEditable */
!!
(
'contentEditable'
in
document
.
createElement
(
'div'
)
)
&&
/* createElementNS */
!!
document
.
createElementNS
&&
/* DOMParser */
(
function
()
{
let
doc
;
try
{
doc
=
new
DOMParser
().
parseFromString
(
'<body></body>'
,
'text/html'
);
}
catch
(
e
)
{}
return
doc
instanceof
HTMLDocument
;
}()
)
&&
/* classList */
!!
(
(
'classList'
in
document
.
createElement
(
'_'
)
)
||
(
'classList'
in
document
.
createElementNS
(
'http://www.w3.org/2000/svg '
,
'g'
)
)
)
&&
/* SVG */
!!
(
'createSVGRect'
in
document
.
createElementNS
(
'http://www.w3.org/2000/svg'
,
'svg'
)
)
);
};
}()
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 21, 19:58 (1 d, 6 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
e1/ef/32a0b5730fa140d4aa8a8e16a9a5
Default Alt Text
ve.init.SupportCheck.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment