Install Chrome Store Web Apps with JavaScript
Being able to install Firefox OS web apps from any domain, not just the platform app store, is a giant step forward in mobile app marketing and freedom. Firefox OS allows installing apps from any or all domains, and it just so happens that the Chrome Web Store allows JavaScript-triggered app installation as well.
JavaScript Install Code
The chrome.webstore.install
method accepts three parameters, the install URL, the success callback, and the error callback:
/* Chrome installation */
var chromeInstallUrl = "path/to/chrome/app";
chrome.webstore.install(chromeInstallUrl,
function() {
// Success!
}, function(err) {
// Error :(
});
The code above triggers installation of the Chrome web app at the given location. The obvious difference from Firefox OS app installation is that callbacks are included in the initial call here, instead of adding adding onsuccess and onerror methods to a resulting install object.
Feature detection via JavaScript is a client side best practice and for all the right reasons, but unfortunately that same functionality hasn't been available within CSS. What we end up doing is repeating the same properties multiple times with each browser prefix. Yuck. Another thing we...
CSS animations aren't just for basic fades or sliding elements anymore -- CSS animations are capable of much more. I've showed you how you can create an exploding logo (applied with JavaScript, but all animation is CSS), an animated Photo Stack, a sweet...
In the five years I've been at Mozilla I've seen some awesome projects. Some of them very popular, some of them very niche, but none of them has inspired me the way the MozVR team's work with WebVR and A-Frame project have.
A-Frame is a community project...
Regardless of our position on vendor prefixes, we have to live with them and occasionally use them to make things work. These prefixes can be used in two formats: the CSS format (-moz-
, as in -moz-element
) and the JS format (navigator.mozApps
). The awesome X-Tag project has...