Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | const nsIX509Cert = Components.interfaces.nsIX509Cert; |
michael@0 | 6 | const nsX509CertDB = "@mozilla.org/security/x509certdb;1"; |
michael@0 | 7 | const nsIX509CertDB = Components.interfaces.nsIX509CertDB; |
michael@0 | 8 | const nsIPKIParamBlock = Components.interfaces.nsIPKIParamBlock; |
michael@0 | 9 | const nsIDialogParamBlock = Components.interfaces.nsIDialogParamBlock; |
michael@0 | 10 | |
michael@0 | 11 | var certdb; |
michael@0 | 12 | var gParams; |
michael@0 | 13 | |
michael@0 | 14 | function setWindowName() |
michael@0 | 15 | { |
michael@0 | 16 | gParams = window.arguments[0].QueryInterface(nsIDialogParamBlock); |
michael@0 | 17 | |
michael@0 | 18 | var typeFlag = gParams.GetString(0); |
michael@0 | 19 | var numberOfCerts = gParams.GetInt(0); |
michael@0 | 20 | |
michael@0 | 21 | var bundle = document.getElementById("pippki_bundle"); |
michael@0 | 22 | var title; |
michael@0 | 23 | var confirm; |
michael@0 | 24 | var impact; |
michael@0 | 25 | |
michael@0 | 26 | if(typeFlag == "mine_tab") |
michael@0 | 27 | { |
michael@0 | 28 | title = bundle.getString("deleteUserCertTitle"); |
michael@0 | 29 | confirm = bundle.getString("deleteUserCertConfirm"); |
michael@0 | 30 | impact = bundle.getString("deleteUserCertImpact"); |
michael@0 | 31 | } |
michael@0 | 32 | else if(typeFlag == "websites_tab") |
michael@0 | 33 | { |
michael@0 | 34 | title = bundle.getString("deleteSslCertTitle3"); |
michael@0 | 35 | confirm = bundle.getString("deleteSslCertConfirm3"); |
michael@0 | 36 | impact = bundle.getString("deleteSslCertImpact3"); |
michael@0 | 37 | } |
michael@0 | 38 | else if(typeFlag == "ca_tab") |
michael@0 | 39 | { |
michael@0 | 40 | title = bundle.getString("deleteCaCertTitle2"); |
michael@0 | 41 | confirm = bundle.getString("deleteCaCertConfirm2"); |
michael@0 | 42 | impact = bundle.getString("deleteCaCertImpactX2"); |
michael@0 | 43 | } |
michael@0 | 44 | else if(typeFlag == "others_tab") |
michael@0 | 45 | { |
michael@0 | 46 | title = bundle.getString("deleteEmailCertTitle"); |
michael@0 | 47 | confirm = bundle.getString("deleteEmailCertConfirm"); |
michael@0 | 48 | impact = bundle.getString("deleteEmailCertImpactDesc"); |
michael@0 | 49 | } |
michael@0 | 50 | else if(typeFlag == "orphan_tab") |
michael@0 | 51 | { |
michael@0 | 52 | title = bundle.getString("deleteOrphanCertTitle"); |
michael@0 | 53 | confirm = bundle.getString("deleteOrphanCertConfirm"); |
michael@0 | 54 | impact = ""; |
michael@0 | 55 | } |
michael@0 | 56 | else |
michael@0 | 57 | { |
michael@0 | 58 | return; |
michael@0 | 59 | } |
michael@0 | 60 | var confirReference = document.getElementById('confirm'); |
michael@0 | 61 | var impactReference = document.getElementById('impact'); |
michael@0 | 62 | document.title = title; |
michael@0 | 63 | |
michael@0 | 64 | setText("confirm",confirm); |
michael@0 | 65 | |
michael@0 | 66 | var box=document.getElementById("certlist"); |
michael@0 | 67 | var text; |
michael@0 | 68 | for(var x=0;x<numberOfCerts;x++) |
michael@0 | 69 | { |
michael@0 | 70 | text = document.createElement("text"); |
michael@0 | 71 | text.setAttribute("value", gParams.GetString(x+1)); |
michael@0 | 72 | box.appendChild(text); |
michael@0 | 73 | } |
michael@0 | 74 | |
michael@0 | 75 | setText("impact",impact); |
michael@0 | 76 | } |
michael@0 | 77 | |
michael@0 | 78 | function doOK() |
michael@0 | 79 | { |
michael@0 | 80 | gParams.SetInt(1, 1); // means OK |
michael@0 | 81 | return true; |
michael@0 | 82 | } |
michael@0 | 83 | |
michael@0 | 84 | function doCancel() |
michael@0 | 85 | { |
michael@0 | 86 | gParams.SetInt(1, 0); // means CANCEL |
michael@0 | 87 | return true; |
michael@0 | 88 | } |