Module org.htmlunit

Interface ScriptElement

All Known Implementing Classes:
HtmlScript, SvgScript

public interface ScriptElement
An element which can handle scripts.
Author:
Ahmed Ashour, Ronald Brill
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the charset used for the script encoding.
    Returns the script source url.
    boolean
    Returns true if this crossorigin attribute is available.
    boolean
    Returns true if this script is deferred.
    boolean
    Returns if executed.
    void
    INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
    Marks this script as created by javascript.
    void
    INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
    Marks this script as parser-inserted (inserted by the parser of the document, including document.write()).
    void
    setExecuted(boolean executed)
    Sets if executed.
    boolean
    INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
    Returns true if this frame was created by javascript.
    boolean
    INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
    Returns true if this script was inserted by the parser of the document.
  • Method Details

    • isExecuted

      boolean isExecuted()
      Returns if executed.
      Returns:
      if executed
    • isDeferred

      boolean isDeferred()
      Returns true if this script is deferred.
      Returns:
      true if this script is deferred
    • isCrossorigin

      boolean isCrossorigin()
      Returns true if this crossorigin attribute is available.
      Returns:
      true if this crossorigin attribute is available.
    • setExecuted

      void setExecuted(boolean executed)
      Sets if executed.
      Parameters:
      executed - if executed
    • getScriptSource

      String getScriptSource()
      Returns the script source url.
      Returns:
      the script source url
    • getScriptCharset

      String getScriptCharset()
      Returns the charset used for the script encoding.
      Returns:
      the charset used for the script encoding
    • markAsCreatedByDomParser

      void markAsCreatedByDomParser()
      INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
      Marks this script as created by javascript. Spec: The following scripts will not execute: scripts in XMLHttpRequest's responseXML documents, scripts in DOMParser-created documents, scripts in documents created by XSLTProcessor's transformToDocument feature, and scripts that are first inserted by a script into a Document that was created using the createDocument() API
    • wasCreatedByDomParser

      boolean wasCreatedByDomParser()
      INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
      Returns true if this frame was created by javascript.
      Returns:
      true or false
    • markAsParserInserted

      void markAsParserInserted()
      INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
      Marks this script as parser-inserted (inserted by the parser of the document, including document.write()). Spec: the defer attribute has only an effect for parser-inserted scripts.
    • wasParserInserted

      boolean wasParserInserted()
      INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
      Returns true if this script was inserted by the parser of the document.
      Returns:
      true or false