0
|
1
|
|
2 function tinyurl_update_notifyToggle(){
|
|
3
|
|
4 try{
|
|
5 var oPrefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch("");
|
|
6 oPrefs.setBoolPref("tinyurl.update.notify", !document.getElementById("tinyurl.update.notify").checked);
|
|
7 }catch(err){}
|
|
8
|
|
9 return true;
|
|
10 }
|
|
11
|
|
12 function tinyurl_update_install(){
|
|
13 try{
|
|
14 //Window Argument is update XPI
|
|
15 if(window.arguments.length > 0 && typeof(window.arguments[0]) != 'undefined'){
|
|
16
|
|
17 var aInstall = new Array();
|
|
18 aInstall["TinUrl"] = window.arguments[0];
|
|
19
|
|
20 InstallTrigger.install(aInstall, null);
|
|
21 }
|
|
22 //If no update XPI, redirect to download site
|
|
23 else{
|
|
24 window.open(gTinyUrl_DownloadSite).focus();
|
|
25
|
|
26 if(opener != null)
|
|
27 opener.close();
|
|
28 self.close();
|
|
29 }
|
|
30 }catch(err){alert("An unknown error ocurred.\nCould not upgrade.")}
|
|
31
|
|
32 return true;
|
|
33 } |