Interface OpenInNewTabAction.OpenInNewTabJs

All Superinterfaces:
Serializable
Enclosing class:
OpenInNewTabAction

@JsDefinition public static interface OpenInNewTabAction.OpenInNewTabJs extends Serializable
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 Type
    Method
    Description
    An action that opens the URL of an input in a new browser tab, unless it is a javascript: 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 a javascript: 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, and String(u) keeps the test from throwing for a value that is not a string.
      Parameters:
      url - the input producing the URL
      features - the input producing the features of window.open
      Returns:
      the action function