mirror of
https://github.com/fergalmoran/chrometophone.git
synced 2025-12-22 09:41:51 +00:00
Register/unregister the protocol handlers automatically based on the preferences (can be tested in about:config).
Added handlers for the protocols that the phone understands.
This commit is contained in:
@@ -153,18 +153,16 @@ var sendtophoneCore = {
|
||||
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);
|
||||
|
||||
if (!(/^(https?):/i).test( url ))
|
||||
{
|
||||
var prefs = Cc["@mozilla.org/preferences-service;1"]
|
||||
.getService(Ci.nsIPrefService)
|
||||
.getBranch("extensions.sendtophone.") ;
|
||||
|
||||
// Rewrite the URI so it's send first to the proxy
|
||||
var proxyUrl = prefs.getCharPref( "proxyUrl" ) ;
|
||||
|
||||
// rewrite the URI so it's send first to the proxy
|
||||
url = proxyUrl + encodedUri;
|
||||
if (proxyUrl)
|
||||
url = proxyUrl + encodeURIComponent( url);
|
||||
}
|
||||
|
||||
var data = 'title=' + encodeURIComponent(title) +
|
||||
|
||||
Reference in New Issue
Block a user