com.vaadin.polymer.platinum.widget.PlatinumSwImportScript Maven / Gradle / Ivy
/*
* This code was generated with Vaadin Web Component GWT API Generator,
* from platinum-sw project by The Polymer Authors
* that is licensed with http://polymer.github.io/LICENSE.txt license.
*/
package com.vaadin.polymer.platinum.widget;
import com.vaadin.polymer.platinum.*;
import com.vaadin.polymer.*;
import com.vaadin.polymer.elemental.*;
import com.vaadin.polymer.PolymerWidget;
import com.google.gwt.core.client.JsArray;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.core.client.JavaScriptObject;
/**
* The <platinum-sw-import-script>
element is used to import a JavaScript file that is executed
each time the service worker starts up.
* <platinum-sw-import-script>
needs to be a child element of <platinum-sw-register>
.
* A common use case is to define a custom request handler for a fetch
event, but it can be used
for any type of code that you want to be executed by the service worker.
* <platinum-sw-register auto-register>
* <platinum-sw-import-script href="custom-fetch-handler.js"></platinum-sw-import-script>
* <platinum-sw-fetch handler="customFetchHandler"
* path="/(.*)/customFetch"></platinum-sw-fetch>
* </platinum-sw-register>
*
*
*
You can specify multiple <platinum-sw-import-script>
elements, each one corresponding to a
different JavaScript file. The JavaScript files will be loaded in the order in which the
<platinum-sw-import-script>
elements appear. Under the hood, this results in an
importScripts()
call made from the context of the service worker.
*/
public class PlatinumSwImportScript extends PolymerWidget {
/**
* Default Constructor.
*/
public PlatinumSwImportScript() {
this("");
}
/**
* Constructor used by UIBinder to create widgets with content.
*/
public PlatinumSwImportScript(String html) {
super(PlatinumSwImportScriptElement.TAG, PlatinumSwImportScriptElement.SRC, html);
}
/**
* Gets a handle to the Polymer object's underlying DOM element.
*/
public PlatinumSwImportScriptElement getPolymerElement() {
return (PlatinumSwImportScriptElement) getElement();
}
/**
* The URL of the JavaScript file that you want imported.
* Relative URLs are assumed to be
relative to the service worker’s script location, which will almost always be the same
location as the page which includes this element.
*
* JavaScript Info:
* @property href
* @type string
*
*/
public String getHref() {
return getPolymerElement().getHref();
}
/**
* The URL of the JavaScript file that you want imported.
* Relative URLs are assumed to be
relative to the service worker’s script location, which will almost always be the same
location as the page which includes this element.
*
* JavaScript Info:
* @property href
* @type string
*
*/
public void setHref(String value) {
getPolymerElement().setHref(value);
}
}