Remove dead locales.

Simplified the protocol handler code and make it work with Firefox 4. 
For the moment it's back to handle only market: links until a preferences pane is implemented.
This commit is contained in:
amla70
2010-07-30 22:54:27 +00:00
parent d7fade85b2
commit 006a2e9bb7
19 changed files with 100 additions and 349 deletions

View File

@@ -152,6 +152,21 @@ var sendtophoneCore = {
if (!this.sendUrl)
this.init();
// Send the protocols that aren't currently whitelisted through a proxy server
if ((/^(market|tel|sms|ftp):/i).test( url ))
{
var encodedUri = encodeURIComponent( url);
var prefs = Cc["@mozilla.org/preferences-service;1"]
.getService(Ci.nsIPrefService)
.getBranch("extensions.sendtophone.") ;
var proxyUrl = prefs.getCharPref( "proxyUrl" ) ;
// rewrite the URI so it's send first to the proxy
url = proxyUrl + encodedUri;
}
var data = 'title=' + encodeURIComponent(title) +
'&url=' + encodeURIComponent(url) + '&sel=' + encodeURIComponent(selection);