mirror of
https://github.com/fergalmoran/chrometophone.git
synced 2025-12-22 09:41:51 +00:00
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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user