Ensure app origin is encoded (bug 1065006)

Doesn't it seem better to do something like:

In [20]: urllib.quote_plus('app://plz.ktnx.')
Out[20]: 'app%3A%2F%2Fplz.ktnx.'