Interface OpenInNewTabAction.OpenInNewTabJs
- All Superinterfaces:
Serializable
- Enclosing class:
OpenInNewTabAction
How a URL is opened in a new tab, as a snippet for
JsSnippets.of(Class).
For internal use only. May be renamed or removed in a future release.
-
Method Summary
Modifier and TypeMethodDescriptionopenInNewTab(JsFunction url, JsFunction features) An action that opens the URL of an input in a new browser tab, unless it is ajavascript:URL, so that a URL produced on the client can not run script in the origin of the page.
-
Method Details
-
openInNewTab
@JsExpression("((u) => /^[\\x00-\\x20]*javascript:/i.test(String(u)) || window.open(u, \"_blank\", $1(event)))($0(event))") @JsFunctionParameterNames("event") JsFunction openInNewTab(JsFunction url, JsFunction features) An action that opens the URL of an input in a new browser tab, unless it is ajavascript:URL, so that a URL produced on the client can not run script in the origin of the page. The pattern skips the leading C0 controls and spaces that the URL parser strips before the scheme and ignores case, andString(u)keeps the test from throwing for a value that is not a string.- Parameters:
url- the input producing the URLfeatures- the input producing the features ofwindow.open- Returns:
- the action function
-