Document-level global Polymer settings can be set by creating a Polymer object on window before importing the Polymer library:

<html>
  <head>
  <meta charset="utf-8">
  <script src="components/webcomponentsjs/webcomponents-loader.js"></script>
  <script>
    /* this script must run before Polymer is imported */
    window.Polymer = {
      rootPath: '/your/application/root'
    };
  </script>
  <!-- a component that relies on Polymer -->
  <link rel="import" href="elements/my-app.html">
  </head>
  <body>
  ...

Available settings:

Setting Description
rootPath Sets a global rootPath property that can be used in templates to generate URLs that are relative to the application root.
sanitizeDOMValue A global callback used to sanitize any value before inserting it into the DOM. The callback signature is:
Polymer = {
  sanitizeDOMValue: function(value, name, type, node) { ... }
}

Where:

  • value is the value to sanitize.
  • name is the name of an attribute or property (for example, href).
  • type indicates where the value is being inserted: one of property, attribute, or text.
  • node is the node where the value is being inserted.

There are also a number of polyfill-specific settings. See Polyfills for details.