Class Polyfill

java.lang.Object
org.htmlunit.javascript.polyfill.Polyfill

public class Polyfill extends Object
Support to use polyfills for js features not implemented so far (idea from Colin Alworth).
  • Field Details

    • CACHE

      private static final Map<String,Polyfill> CACHE
    • url_

      private String url_
    • source_

      private String source_
    • script_

      private org.htmlunit.corejs.javascript.Script script_
  • Constructor Details

    • Polyfill

      public Polyfill()
  • Method Details

    • getFetchPolyfill

      public static Polyfill getFetchPolyfill() throws IOException
      Throws:
      IOException
    • getPolyfill

      private static Polyfill getPolyfill(String resouceName) throws IOException
      Throws:
      IOException
    • apply

      public void apply(org.htmlunit.corejs.javascript.Context context, org.htmlunit.corejs.javascript.Scriptable scriptable)
      Compile the script if needed and exec to setup the context.
      Parameters:
      context - the context
      scriptable - the scriptable