{{APIRef}}
The oninstall
property of the {{domxref("Window")}} interface represent the event handler for the {{Event("install")}} event, which is thrown each time the page is successfully installed as a web app.
Syntax
window.oninstall = function(event) { ... };
Example
function handleInstall(ev) { console.log('Thank you for installing our app!'); } window.oninstall = handleInstall;
Specifications
Specification | Status | Comment |
---|---|---|
{{SpecName('Manifest', '#oninstall-attribute', 'Window.oninstall')}} | {{Spec2('Manifest')}} | Initial specification. |
Browser compatibility
{{CompatibilityTable}}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | {{CompatUnknown}} | {{CompatGeckoDesktop(49)}} [1] | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
Feature | Android | Android Webview | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile | Chrome for Android |
---|---|---|---|---|---|---|---|
Basic support | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatGeckoMobile(49)}} [1] | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
[1] This feature is behind a feature preference setting. In about:config, set dom.manifest.oninstall
to true
.
See also
- {{Event("install")}}