Mercurial > tinyurl_creator
view chrome/content/dialogs/update.js @ 0:c14d52a3b2fe
initial import
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Mon, 11 Aug 2008 20:34:21 +0900 |
parents | |
children |
line wrap: on
line source
function tinyurl_update_notifyToggle(){ try{ var oPrefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch(""); oPrefs.setBoolPref("tinyurl.update.notify", !document.getElementById("tinyurl.update.notify").checked); }catch(err){} return true; } function tinyurl_update_install(){ try{ //Window Argument is update XPI if(window.arguments.length > 0 && typeof(window.arguments[0]) != 'undefined'){ var aInstall = new Array(); aInstall["TinUrl"] = window.arguments[0]; InstallTrigger.install(aInstall, null); } //If no update XPI, redirect to download site else{ window.open(gTinyUrl_DownloadSite).focus(); if(opener != null) opener.close(); self.close(); } }catch(err){alert("An unknown error ocurred.\nCould not upgrade.")} return true; }