Skip to content

Latest commit

 

History

History
1665 lines (855 loc) · 38.5 KB

FeatureConstructor.md

File metadata and controls

1665 lines (855 loc) · 38.5 KB

JScrewItDocs


Interface: FeatureConstructor()

Extends

FeatureConstructor(...features): CustomFeature

Creates a new feature object from the union of the specified features.

The constructor can be used with or without the new operator, e.g. new JScrewIt.Feature(feature1, feature2) or JScrewIt.Feature(feature1, feature2). If no arguments are specified, the new feature object will be equivalent to DEFAULT.

Parameters

• ...features: FeatureElementOrCompatibleArray[]

Returns

CustomFeature

Example

The following statements are equivalent, and will all construct a new feature object including both ANY_DOCUMENT and ANY_WINDOW.

new JScrewIt.Feature("ANY_DOCUMENT", "ANY_WINDOW");
new JScrewIt.Feature(JScrewIt.Feature.ANY_DOCUMENT, JScrewIt.Feature.ANY_WINDOW);
new JScrewIt.Feature([JScrewIt.Feature.ANY_DOCUMENT, JScrewIt.Feature.ANY_WINDOW]);

Throws

An error is thrown if any of the specified features are not mutually compatible.

Constructors

new FeatureConstructor()

new FeatureConstructor(...features): CustomFeature

Creates a new feature object from the union of the specified features.

The constructor can be used with or without the new operator, e.g. new JScrewIt.Feature(feature1, feature2) or JScrewIt.Feature(feature1, feature2). If no arguments are specified, the new feature object will be equivalent to DEFAULT.

Parameters

• ...features: FeatureElementOrCompatibleArray[]

Returns

CustomFeature

Inherited from

FeatureAll.constructor

Example

The following statements are equivalent, and will all construct a new feature object including both ANY_DOCUMENT and ANY_WINDOW.

JScrewIt.Feature("ANY_DOCUMENT", "ANY_WINDOW");
JScrewIt.Feature(JScrewIt.Feature.ANY_DOCUMENT, JScrewIt.Feature.ANY_WINDOW);
JScrewIt.Feature([JScrewIt.Feature.ANY_DOCUMENT, JScrewIt.Feature.ANY_WINDOW]);

Throws

An error is thrown if any of the specified features are not mutually compatible.

Properties

ALL

readonly ALL: FeatureAll

An immutable mapping of all predefined feature objects accessed by name or alias.

Example

This will produce an array with the names and aliases of all predefined features.

Object.keys(JScrewIt.Feature.ALL)

This will determine if a particular feature object is predefined or not.

featureObj === JScrewIt.Feature.ALL[featureObj.name]

ANDRO_4_0

ANDRO_4_0: PredefinedFeature

Features available in Android Browser 4.0.

Inherited from

FeatureAll.ANDRO_4_0


ANDRO_4_1

ANDRO_4_1: PredefinedFeature

Features available in Android Browser 4.1 to 4.3.

Inherited from

FeatureAll.ANDRO_4_1


ANDRO_4_4

ANDRO_4_4: PredefinedFeature

Features available in Android Browser 4.4.

Inherited from

FeatureAll.ANDRO_4_4


ANY_DOCUMENT

ANY_DOCUMENT: ElementaryFeature

Existence of the global object document whose string representation starts with "[object " and ends with "Document]".

Remarks

Available in Chrome, Edge, Firefox, Internet Explorer, Safari, Opera, and Android Browser. This feature is not available inside web workers.

Inherited from

FeatureAll.ANY_DOCUMENT


ANY_WINDOW

ANY_WINDOW: ElementaryFeature

Existence of the global object self whose string representation starts with "[object " and ends with "Window]".

Remarks

Available in Chrome, Edge, Firefox, Internet Explorer, Safari, Opera, and Android Browser. This feature is not available inside web workers.

Inherited from

FeatureAll.ANY_WINDOW


ARRAY_ITERATOR

ARRAY_ITERATOR: ElementaryFeature

The property that the string representation of Array.prototype.entries() starts with "[object Array" and ends with "]" at index 21 or 22.

Remarks

Available in Chrome, Edge, Firefox, Safari 7.1+, Opera, and Node.js 0.12+.

Inherited from

FeatureAll.ARRAY_ITERATOR


ARROW

ARROW: ElementaryFeature

Support for arrow functions.

Remarks

Available in Chrome, Edge, Firefox, Safari 10+, Opera, and Node.js 4+.

Inherited from

FeatureAll.ARROW


AT

AT: ElementaryFeature

Existence of the native function Array.prototype.at.

Remarks

Available in Chrome, Edge, Firefox, Safari 15.4+, Opera, and Node.js 16.6+.

Inherited from

FeatureAll.AT


ATOB

ATOB: ElementaryFeature

Existence of the global functions atob and btoa.

Remarks

Available in Chrome, Edge, Firefox, Internet Explorer 10+, Safari, Opera, Android Browser, and Node.js 16.0+. This feature is not available inside web workers in Safari before 10.

Inherited from

FeatureAll.ATOB


AUTO

AUTO: PredefinedFeature

Features available in the current environment.

Inherited from

FeatureAll.AUTO


BARPROP

BARPROP: ElementaryFeature

Existence of the global object statusbar having the string representation "[object BarProp]".

Remarks

Available in Chrome, Edge, Firefox, Safari, Opera, and Android Browser 4.4. This feature is not available inside web workers.

Inherited from

FeatureAll.BARPROP


BROWSER

BROWSER: PredefinedFeature

Features available in all browsers.

No support for Node.js.

Inherited from

FeatureAll.BROWSER


CAPITAL_HTML

CAPITAL_HTML: ElementaryFeature

The property that the various string methods returning HTML code such as String.prototype.big or String.prototype.link have both the tag name and attributes written in capital letters.

Remarks

Available in Internet Explorer.

Inherited from

FeatureAll.CAPITAL_HTML


CHROME

CHROME: PredefinedFeature

Features available in the current stable versions of Chrome, Edge and Opera.

An alias for CHROME_122.

Inherited from

FeatureAll.CHROME


CHROME_122

CHROME_122: PredefinedFeature

Features available in Chrome 122, Edge 122 and Opera 108 or later.

Remarks

This feature may be replaced or removed in the near future when current browser versions become obsolete. Use CHROME or CHROME_PREV instead of CHROME_122 for long term support.

See

Engine Support Policy

Inherited from

FeatureAll.CHROME_122


CHROME_PREV

CHROME_PREV: PredefinedFeature

Features available in the previous to current versions of Chrome and Edge.

An alias for CHROME_122.

Inherited from

FeatureAll.CHROME_PREV


COMPACT

COMPACT: PredefinedFeature

All new browsers' features.

No support for Node.js and older browsers like Internet Explorer, Safari 17.3 or Android Browser.

Inherited from

FeatureAll.COMPACT


CONSOLE

CONSOLE: ElementaryFeature

Existence of the global object console having the string representation "[object Console]".

This feature may become unavailable when certain browser extensions are active.

Remarks

Available in Internet Explorer 10+, Safari before 14.1, and Android Browser. This feature is not available inside web workers in Safari before 7.1 and Android Browser 4.4.

Inherited from

FeatureAll.CONSOLE


DEFAULT

DEFAULT: PredefinedFeature

Minimum feature level, compatible with all supported engines in all environments.

Inherited from

FeatureAll.DEFAULT


DOCUMENT

DOCUMENT: ElementaryFeature

Existence of the global object document having the string representation "[object Document]".

Remarks

Available in Internet Explorer before 11. This feature is not available inside web workers.

Inherited from

FeatureAll.DOCUMENT


DOMWINDOW

DOMWINDOW: ElementaryFeature

Existence of the global object self having the string representation "[object DOMWindow]".

Remarks

Available in Android Browser before 4.4. This feature is not available inside web workers.

Inherited from

FeatureAll.DOMWINDOW


ELEMENTARY

readonly ELEMENTARY: readonly ElementaryFeature[]

An immutable array of all elementary feature objects ordered by name.


ESC_HTML_ALL

ESC_HTML_ALL: ElementaryFeature

The property that double quotation mark, less than and greater than characters in the argument of String.prototype.fontcolor are escaped into their respective HTML entities.

Remarks

Available in Android Browser and Node.js before 0.12.

Inherited from

FeatureAll.ESC_HTML_ALL


ESC_HTML_QUOT

ESC_HTML_QUOT: ElementaryFeature

The property that double quotation marks in the argument of String.prototype.fontcolor are escaped as """.

Remarks

Available in Chrome, Edge, Firefox, Safari, Opera, Android Browser, and Node.js.

Inherited from

FeatureAll.ESC_HTML_QUOT


ESC_HTML_QUOT_ONLY

ESC_HTML_QUOT_ONLY: ElementaryFeature

The property that only double quotation marks and no other characters in the argument of String.prototype.fontcolor are escaped into HTML entities.

Remarks

Available in Chrome, Edge, Firefox, Safari, Opera, and Node.js 0.12+.

Inherited from

FeatureAll.ESC_HTML_QUOT_ONLY


ESC_REGEXP_LF

ESC_REGEXP_LF: ElementaryFeature

Having regular expressions created with the RegExp constructor use escape sequences starting with a backslash to format line feed characters ("\n") in their string representation.

Remarks

Available in Chrome, Edge, Firefox, Internet Explorer, Safari, Opera, and Node.js 12+.

Inherited from

FeatureAll.ESC_REGEXP_LF


ESC_REGEXP_SLASH

ESC_REGEXP_SLASH: ElementaryFeature

Having regular expressions created with the RegExp constructor use escape sequences starting with a backslash to format slashes ("/") in their string representation.

Remarks

Available in Chrome, Edge, Firefox, Internet Explorer, Safari, Opera, and Node.js 4+.

Inherited from

FeatureAll.ESC_REGEXP_SLASH


FF

FF: PredefinedFeature

Features available in the current stable version of Firefox.

An alias for FF_90.

Inherited from

FeatureAll.FF


FF_90

FF_90: PredefinedFeature

Features available in Firefox 90 or later.

Remarks

This feature may be replaced or removed in the near future when current browser versions become obsolete. Use FF, FF_ESR, or FF_PREV instead of FF_90 for long term support.

See

Engine Support Policy

Inherited from

FeatureAll.FF_90


FF_ESR

FF_ESR: PredefinedFeature

Features available in the current version of Firefox ESR.

An alias for FF_90.

Inherited from

FeatureAll.FF_ESR


FF_PREV

FF_PREV: PredefinedFeature

Features available in the previous to current version of Firefox.

An alias for FF_90.

Inherited from

FeatureAll.FF_PREV


FF_SRC

FF_SRC: ElementaryFeature

A string representation of native functions typical for Firefox and Safari.

Remarkable traits are the lack of line feed characters at the beginning and at the end of the string and the presence of a line feed followed by four whitespaces ("\n ") before the "[native code]" sequence.

Remarks

Available in Firefox and Safari.

Inherited from

FeatureAll.FF_SRC


FILL

FILL: ElementaryFeature

Existence of the native function Array.prototype.fill.

Remarks

Available in Chrome, Edge, Firefox, Safari 7.1+, Opera, and Node.js 4+.

Inherited from

FeatureAll.FILL


FLAT

FLAT: ElementaryFeature

Existence of the native function Array.prototype.flat.

Remarks

Available in Chrome, Edge, Firefox, Safari 12+, Opera, and Node.js 11+.

Inherited from

FeatureAll.FLAT


FROM_CODE_POINT

FROM_CODE_POINT: ElementaryFeature

Existence of the function String.fromCodePoint.

Remarks

Available in Chrome, Edge, Firefox, Safari 9+, Opera, and Node.js 4+.

Inherited from

FeatureAll.FROM_CODE_POINT


FUNCTION_19_LF

FUNCTION_19_LF: ElementaryFeature

A string representation of dynamically generated functions where the character at index 19 is a line feed ("\n").

Remarks

Available in Chrome, Edge, Firefox, Safari 17.4+, Opera, and Node.js 10+.

Inherited from

FeatureAll.FUNCTION_19_LF


FUNCTION_22_LF

FUNCTION_22_LF: ElementaryFeature

A string representation of dynamically generated functions where the character at index 22 is a line feed ("\n").

Remarks

Available in Internet Explorer, Safari 9+ before 17.4, Android Browser, and Node.js before 10.

Inherited from

FeatureAll.FUNCTION_22_LF


GENERIC_ARRAY_TO_STRING

GENERIC_ARRAY_TO_STRING: ElementaryFeature

Ability to call Array.prototype.toString with a non-array binding.

Remarks

Available in Chrome, Edge, Firefox, Internet Explorer, Safari, Opera, Android Browser 4.1+, and Node.js.

Inherited from

FeatureAll.GENERIC_ARRAY_TO_STRING


GLOBAL_UNDEFINED

GLOBAL_UNDEFINED: ElementaryFeature

Having the global function toString return the string "[object Undefined]" when invoked without a binding.

Remarks

Available in Chrome, Edge, Firefox, Safari, Opera, and Node.js.

Inherited from

FeatureAll.GLOBAL_UNDEFINED


GMT

GMT: ElementaryFeature

Presence of the text "GMT" after the first 25 characters in the string returned by Date().

The string representation of dates is implementation dependent, but most engines use a similar format, making this feature available in all supported engines except Internet Explorer 9 and 10.

Remarks

Available in Chrome, Edge, Firefox, Internet Explorer 11, Safari, Opera, Android Browser, and Node.js.

Inherited from

FeatureAll.GMT


HISTORY

HISTORY: ElementaryFeature

Existence of the global object history having the string representation "[object History]".

Remarks

Available in Chrome, Edge, Firefox, Internet Explorer, Safari, Opera, and Android Browser. This feature is not available inside web workers.

Inherited from

FeatureAll.HISTORY


HTMLAUDIOELEMENT

HTMLAUDIOELEMENT: ElementaryFeature

Existence of the global object Audio whose string representation starts with "function HTMLAudioElement".

Remarks

Available in Android Browser 4.4. This feature is not available inside web workers.

Inherited from

FeatureAll.HTMLAUDIOELEMENT


HTMLDOCUMENT

HTMLDOCUMENT: ElementaryFeature

Existence of the global object document having the string representation "[object HTMLDocument]".

Remarks

Available in Chrome, Edge, Firefox, Internet Explorer 11, Safari, Opera, and Android Browser. This feature is not available inside web workers.

Inherited from

FeatureAll.HTMLDOCUMENT


IE_10

IE_10: PredefinedFeature

Features available in Internet Explorer 10.

Inherited from

FeatureAll.IE_10


IE_11

IE_11: PredefinedFeature

Features available in Internet Explorer 11.

Inherited from

FeatureAll.IE_11


IE_11_WIN_10

IE_11_WIN_10: PredefinedFeature

Features available in Internet Explorer 11 on Windows 10.

Inherited from

FeatureAll.IE_11_WIN_10


IE_9

IE_9: PredefinedFeature

Features available in Internet Explorer 9.

Inherited from

FeatureAll.IE_9


IE_SRC

IE_SRC: ElementaryFeature

A string representation of native functions typical for Internet Explorer.

Remarkable traits are the presence of a line feed character ("\n") at the beginning and at the end of the string and a line feed followed by four whitespaces ("\n ") before the "[native code]" sequence.

Remarks

Available in Internet Explorer.

Inherited from

FeatureAll.IE_SRC


INCR_CHAR

INCR_CHAR: ElementaryFeature

The ability to use unary increment operators with string characters, like in ( ++"some string"[0] ): this will result in a TypeError in strict mode in ECMAScript compliant engines.

Remarks

Available in Chrome, Edge, Firefox, Internet Explorer, Safari, Opera, Android Browser, and Node.js. This feature is not available when strict mode is enforced in Chrome, Edge, Firefox, Internet Explorer 10+, Safari, Opera, and Node.js 5+.

Inherited from

FeatureAll.INCR_CHAR


INTL

INTL: ElementaryFeature

Existence of the global object Intl.

Remarks

Available in Chrome, Edge, Firefox, Internet Explorer 11, Safari 10+, Opera, Android Browser 4.4, and Node.js 0.12+.

Inherited from

FeatureAll.INTL


LOCALE_INFINITY

LOCALE_INFINITY: ElementaryFeature

Language sensitive string representation of Infinity as "∞".

Remarks

Available in Chrome, Edge, Firefox, Internet Explorer 11 on Windows 10, Safari 10+, Opera, Android Browser 4.4, and Node.js 0.12+.

Inherited from

FeatureAll.LOCALE_INFINITY


LOCALE_NUMERALS

LOCALE_NUMERALS: ElementaryFeature

Features shared by all engines capable of localized number formatting, including output of Arabic digits, the Arabic decimal separator "٫", the letters in the first word of the Arabic string representation of NaN ("ليس"), Persian digits and the Persian digit group separator "٬".

Remarks

Available in Chrome, Edge, Firefox, Internet Explorer 11, Safari 10+, Opera, Android Browser 4.4, and Node.js 13+.

Inherited from

FeatureAll.LOCALE_NUMERALS


LOCALE_NUMERALS_EXT

LOCALE_NUMERALS_EXT: ElementaryFeature

Extended localized number formatting.

This includes all features of LOCALE_NUMERALS plus the output of the first three letters in the second word of the Arabic string representation of NaN ("رقم"), Bengali digits, the letters in the Russian string representation of NaN ("не число") and the letters in the Persian string representation of NaN ("ناعدد").

Remarks

Available in Chrome, Edge, Firefox, Internet Explorer 11 on Windows 10, Safari 10+, Opera, Android Browser 4.4, and Node.js 13+.

Inherited from

FeatureAll.LOCALE_NUMERALS_EXT


LOCATION

LOCATION: ElementaryFeature

Existence of the global object location with the property that Object.prototype.toString.call(location) evaluates to a string that starts with "[object " and ends with "Location]".

Remarks

Available in Chrome, Edge, Firefox, Safari, Opera, and Android Browser.

Inherited from

FeatureAll.LOCATION


NAME

NAME: ElementaryFeature

Existence of the name property for functions.

Remarks

Available in Chrome, Edge, Firefox, Safari, Opera, Android Browser, and Node.js.

Inherited from

FeatureAll.NAME


NODECONSTRUCTOR

NODECONSTRUCTOR: ElementaryFeature

Existence of the global object Node having the string representation "[object NodeConstructor]".

Remarks

Available in Safari before 10. This feature is not available inside web workers.

Inherited from

FeatureAll.NODECONSTRUCTOR


NODE_0_10

NODE_0_10: PredefinedFeature

Features available in Node.js 0.10.

Inherited from

FeatureAll.NODE_0_10


NODE_0_12

NODE_0_12: PredefinedFeature

Features available in Node.js 0.12.

Inherited from

FeatureAll.NODE_0_12


NODE_10

NODE_10: PredefinedFeature

Features available in Node.js 10.

Inherited from

FeatureAll.NODE_10


NODE_11

NODE_11: PredefinedFeature

Features available in Node.js 11.

Inherited from

FeatureAll.NODE_11


NODE_12

NODE_12: PredefinedFeature

Features available in Node.js 12.

Inherited from

FeatureAll.NODE_12


NODE_13

NODE_13: PredefinedFeature

Features available in Node.js 13 and Node.js 14.

Inherited from

FeatureAll.NODE_13


NODE_15

NODE_15: PredefinedFeature

Features available in Node.js 15.

Inherited from

FeatureAll.NODE_15


NODE_16_0

NODE_16_0: PredefinedFeature

Features available in Node.js 16.0 to 16.5.

Inherited from

FeatureAll.NODE_16_0


NODE_16_6

NODE_16_6: PredefinedFeature

Features available in Node.js 16.6 to 21.

Inherited from

FeatureAll.NODE_16_6


NODE_22

NODE_22: PredefinedFeature

Features available in Node.js 22 or later.

Inherited from

FeatureAll.NODE_22


NODE_4

NODE_4: PredefinedFeature

Features available in Node.js 4.

Inherited from

FeatureAll.NODE_4


NODE_5

NODE_5: PredefinedFeature

Features available in Node.js 5 to 9.

Inherited from

FeatureAll.NODE_5


NO_FF_SRC

NO_FF_SRC: ElementaryFeature

A string representation of native functions typical for V8 or for Internet Explorer but not for Firefox and Safari.

Remarks

Available in Chrome, Edge, Internet Explorer, Opera, Android Browser, and Node.js.

Inherited from

FeatureAll.NO_FF_SRC


NO_IE_SRC

NO_IE_SRC: ElementaryFeature

A string representation of native functions typical for most engines with the notable exception of Internet Explorer.

A remarkable trait of this feature is the lack of line feed characters at the beginning and at the end of the string.

Remarks

Available in Chrome, Edge, Firefox, Safari, Opera, Android Browser, and Node.js.

Inherited from

FeatureAll.NO_IE_SRC


NO_OLD_SAFARI_ARRAY_ITERATOR

NO_OLD_SAFARI_ARRAY_ITERATOR: ElementaryFeature

The property that the string representation of Array.prototype.entries() evaluates to "[object Array Iterator]".

Remarks

Available in Chrome, Edge, Firefox, Safari 9+, Opera, and Node.js 0.12+.

Inherited from

FeatureAll.NO_OLD_SAFARI_ARRAY_ITERATOR


NO_V8_SRC

NO_V8_SRC: ElementaryFeature

A string representation of native functions typical for Firefox, Internet Explorer and Safari.

A most remarkable trait of this feature is the presence of a line feed followed by four whitespaces ("\n ") before the "[native code]" sequence.

Remarks

Available in Firefox, Internet Explorer, and Safari.

Inherited from

FeatureAll.NO_V8_SRC


OBJECT_ARRAY_ENTRIES_CTOR

OBJECT_ARRAY_ENTRIES_CTOR: ElementaryFeature

The property that the Array.prototype.entries().constructor is the Object constructor.

Remarks

Available in Firefox, Safari 9+, and Node.js 0.12+ before 22.

Inherited from

FeatureAll.OBJECT_ARRAY_ENTRIES_CTOR


OBJECT_L_LOCATION_CTOR

OBJECT_L_LOCATION_CTOR: ElementaryFeature

Existence of the global function location.constructor whose string representation starts with "[object L".

Remarks

Available in Internet Explorer and Safari before 10. This feature is not available inside web workers.

Inherited from

FeatureAll.OBJECT_L_LOCATION_CTOR


OBJECT_UNDEFINED

OBJECT_UNDEFINED: ElementaryFeature

Having the function Object.prototype.toString return the string "[object Undefined]" when invoked without a binding.

Remarks

Available in Chrome, Edge, Firefox, Internet Explorer 10+, Safari, Opera, Android Browser 4.1+, and Node.js.

Inherited from

FeatureAll.OBJECT_UNDEFINED


OBJECT_W_CTOR

OBJECT_W_CTOR: ElementaryFeature

The property that the string representation of the global object constructor starts with "[object W".

Remarks

Available in Internet Explorer and Safari before 10. This feature is not available inside web workers in Safari before 10.

Inherited from

FeatureAll.OBJECT_W_CTOR


OLD_SAFARI_LOCATION_CTOR

OLD_SAFARI_LOCATION_CTOR: ElementaryFeature

Existence of the global object location.constructor whose string representation starts with "[object " and ends with "LocationConstructor]".

Remarks

Available in Safari before 10.

Inherited from

FeatureAll.OLD_SAFARI_LOCATION_CTOR


PLAIN_INTL

PLAIN_INTL: ElementaryFeature

Existence of the global object Intl having the string representation "[object Object]".

Remarks

Available in Internet Explorer 11, Safari 10+ before 14.0.1, Android Browser 4.4, and Node.js 0.12+ before 15.

Inherited from

FeatureAll.PLAIN_INTL


REGEXP_STRING_ITERATOR

REGEXP_STRING_ITERATOR: ElementaryFeature

The property that the string representation of String.prototype.matchAll() evaluates to "[object RegExp String Iterator]".

Remarks

Available in Chrome, Edge, Firefox, Safari 13+, Opera, and Node.js 12+.

Inherited from

FeatureAll.REGEXP_STRING_ITERATOR


SAFARI

SAFARI: PredefinedFeature

Features available in the current stable version of Safari.

An alias for SAFARI_17_4.

Inherited from

FeatureAll.SAFARI


SAFARI_10

SAFARI_10: PredefinedFeature

Features available in Safari 10 and Safari 11.

Inherited from

FeatureAll.SAFARI_10


SAFARI_12

SAFARI_12: PredefinedFeature

Features available in Safari 12.

Inherited from

FeatureAll.SAFARI_12


SAFARI_13

SAFARI_13: PredefinedFeature

Features available in Safari 13 and Safari 14.0.0.

Inherited from

FeatureAll.SAFARI_13


SAFARI_14_0_1

SAFARI_14_0_1: PredefinedFeature

Features available in Safari 14.0.1 to 14.0.3.

Inherited from

FeatureAll.SAFARI_14_0_1


SAFARI_14_1

SAFARI_14_1: PredefinedFeature

Features available in Safari 14.1 to 15.3.

Inherited from

FeatureAll.SAFARI_14_1


SAFARI_15_4

SAFARI_15_4: PredefinedFeature

Features available in Safari 15.4 to 17.3.

Inherited from

FeatureAll.SAFARI_15_4


SAFARI_17_4

SAFARI_17_4: PredefinedFeature

Features available in Safari 17.4 or later.

Inherited from

FeatureAll.SAFARI_17_4


SAFARI_7_0

SAFARI_7_0: PredefinedFeature

Features available in Safari 7.0.

Inherited from

FeatureAll.SAFARI_7_0


SAFARI_7_1

SAFARI_7_1: PredefinedFeature

Features available in Safari 7.1 and Safari 8.

Inherited from

FeatureAll.SAFARI_7_1


SAFARI_9

SAFARI_9: PredefinedFeature

Features available in Safari 9.

Inherited from

FeatureAll.SAFARI_9


SELF

SELF: ElementaryFeature

An alias for ANY_WINDOW.

Inherited from

FeatureAll.SELF


SELF_OBJ

SELF_OBJ: ElementaryFeature

Existence of the global object self whose string representation starts with "[object ".

Remarks

Available in Chrome, Edge, Firefox, Internet Explorer, Safari, Opera, and Android Browser. This feature is not available inside web workers in Safari 7.1+ before 10.

Inherited from

FeatureAll.SELF_OBJ


SHORT_LOCALES

SHORT_LOCALES: ElementaryFeature

Support for the two-letter locale name "ar" to format decimal numbers as Arabic numerals.

Remarks

Available in Firefox, Internet Explorer 11, Safari 10+, Android Browser 4.4, and Node.js 13+.

Inherited from

FeatureAll.SHORT_LOCALES


STATUS

STATUS: ElementaryFeature

Existence of the global string status.

Remarks

Available in Chrome, Edge, Firefox, Internet Explorer, Safari, Opera, and Android Browser. This feature is not available inside web workers.

Inherited from

FeatureAll.STATUS


UNDEFINED

UNDEFINED: ElementaryFeature

The property that Object.prototype.toString.call() evaluates to "[object Undefined]".

This behavior is specified by ECMAScript, and is enforced by all engines except Android Browser versions prior to 4.1.2, where this feature is not available.

Remarks

Available in Chrome, Edge, Firefox, Internet Explorer, Safari, Opera, Android Browser 4.1+, and Node.js.

Inherited from

FeatureAll.UNDEFINED


V8_SRC

V8_SRC: ElementaryFeature

A string representation of native functions typical for the V8 engine.

Remarkable traits are the lack of line feed characters at the beginning and at the end of the string and the presence of a single whitespace before the "[native code]" sequence.

Remarks

Available in Chrome, Edge, Opera, Android Browser, and Node.js.

Inherited from

FeatureAll.V8_SRC


WINDOW

WINDOW: ElementaryFeature

Existence of the global object self having the string representation "[object Window]".

Remarks

Available in Chrome, Edge, Firefox, Internet Explorer, Safari, Opera, and Android Browser 4.4. This feature is not available inside web workers.

Inherited from

FeatureAll.WINDOW

Methods

areCompatible()

areCompatible(...features): boolean

Determines whether the specified features are mutually compatible.

Parameters

• ...features: FeatureElement[]

Returns

boolean

true if the specified features are mutually compatible; otherwise, false. If less than two features are specified, the return value is true.

Example

// false: only one of "V8_SRC" or "IE_SRC" may be available.
JScrewIt.Feature.areCompatible("V8_SRC", "IE_SRC")
// true
JScrewIt.Feature.areCompatible(JScrewIt.Feature.DEFAULT, JScrewIt.Feature.FILL)

areEqual()

areEqual(...features): boolean

Determines whether all of the specified features are equivalent.

Different features are considered equivalent if they include the same set of elementary features, regardless of any other difference.

Parameters

• ...features: FeatureElementOrCompatibleArray[]

Returns

boolean

true if all of the specified features are equivalent; otherwise, false. If less than two arguments are specified, the return value is true.

Example

// false
JScrewIt.Feature.areEqual(JScrewIt.Feature.CHROME, JScrewIt.Feature.FF)
// true
JScrewIt.Feature.areEqual("DEFAULT", [])

commonOf()

commonOf(...features): null | CustomFeature

Creates a new feature object equivalent to the intersection of the specified features.

Parameters

• ...features: FeatureElementOrCompatibleArray[]

Returns

null | CustomFeature

A feature object, or null if no arguments are specified.

Example

This will create a new feature object equivalent to NAME.

const newFeature = JScrewIt.Feature.commonOf(["ATOB", "NAME"], ["NAME", "SELF"]);

This will create a new feature object equivalent to FeatureConstructor.ANY_DOCUMENT | ANY_DOCUMENT. This is because both HTMLDOCUMENT and DOCUMENT imply FeatureConstructor.ANY_DOCUMENT | ANY_DOCUMENT.

const newFeature = JScrewIt.Feature.commonOf("HTMLDOCUMENT", "DOCUMENT");

descriptionFor()

descriptionFor(name): string

Returns a short description of a predefined feature in plain English.

Parameters

name: keyof FeatureAll

A name or alias of a predefined feature.

Returns

string

Remarks

Different names or aliases of the same feature may have different descriptions.

Throws

An error is thrown if the specified argument is not a name or alias of a predefined feature.