Re: Installing web apps

> I precisely*didn't*  want to get into a detail about whether everyone should use
> widgets or will use widgets -- I want to argue for XMLHTTPRequest
> being designed to be able to be used not only in an untrusted web page,
> but e.g. from an installed widget, or node.js for that matter,
> which means returning a defined error response when the privilege is
> insufficient, instead of faking a network error.
> I've been trying to write code which will work in any of these.

I've been there; even with <img crossorigin> I hit some snags (which 
have since been fixed).
You're going to want an async privilege check ahead of time.

chrome.permissions.getAll is a good example if checking permissions via 
async, early on in the script.

It's reasonable, at this point, to assume that permissions will not be 
restricted once they are granted in the lifetime of the script.
I don't know if that's a reasonable assumption for the future. In the 
future case, you may need to do a permissions check before
any XHR call.

Probably best to do that, too.

When doing polyfill work, async booting is necessary.


Received on Wednesday, 1 February 2012 21:39:41 UTC