User:Dickvl: Difference between revisions

From MozillaZine Knowledge Base
Jump to navigationJump to search
(→‎TabVisited: (SM 2))
Line 435: Line 435:
AAA=</pre>
AAA=</pre>


===TabVisited for Firefox 3 and SeaMonkey 2 ===
===TabVisited with CSS code===
This version has the CSS code from [https://bugzilla.mozilla.org/show_bug.cgi?id=487242#c0] embedded, so works right "out of the box"!.
This version has the CSS code from [https://bugzilla.mozilla.org/show_bug.cgi?id=487242#c0] embedded, so works right "out of the box"!.<br />
;Save as tabvisited-1-2-fx-sm.xpi
Works with Firefox 3 (maxVersion 4.*) and SeaMonkey 2 (maxVersion 2.0+).<br />
Save as '''tabvisited-1-2-fx-sm.xpi'''
<pre>data:application/octet-stream;base64,
<pre>data:application/octet-stream;base64,
UEsDBBQAAAAIAFsWPDwjY3igZAAAAPAAAAAPABUAY2hyb21lLm1hbmlmZXN0VVQJAAN97WBLfe1g
UEsDBBQAAAAIAFsWPDwjY3igZAAAAPAAAAAPABUAY2hyb21lLm1hbmlmZXN0VVQJAAN97WBLfe1g

Revision as of 03:02, 28 January 2010

Navigator Object

Here is a bookmarklet to display the content of the Navigator object (plugins, mimeTypes).

javascript:/* dickvl@kb.mozillazine.org */
(function(){
var b='<br>',i,L,O,p,pN,pT=('Navigator properties:').bold()+b+b,oT=('Navigator objects:').bold()+b+b,fT=('Navigator functions:').bold()+b+b;
for(pN in navigator){
if(typeof navigator[pN]=='object'){
O=navigator[pN];L=(O.length)?O.length:0;oT+=(pN+': ').bold()+L.toString().bold()+b;
for(i=0;i<L;i++){M=O[i];oT+=('['+(i+1)+'] ').bold();
for(p in M){if(typeof M[p]!='function'&&typeof M[p]!='object'&&p!='length'){oT+=(p+': ').bold()+M[p]+(' | ').bold()}}
if(M.enabledPlugin){oT+=('Plugin: ').bold()+M.enabledPlugin.name}
oT+=b}
oT+=b}
else if(typeof navigator[pN]!='function'){pT+=(pN+': ').bold()+navigator[pN]+b}
else if(typeof navigator[pN]=='function'){if(/Enabled/.test(pN)){fT+=(pN+': ').bold()+navigator[pN]()+b}}}
with(document.open()){write(pT+b+oT+b+fT);close();}
})();

Add-ons

Sometime ago I noticed the Mozilla's Places Stats Project thread with the possibility to display a list of installed extensions in JSON notation by using the Error Console. That gave me an idea to do the same for the printing passwords code in the Password Manager article.

I have also taken the opportunity to create a similar file for displaying the installed extensions. So here are two versions.
The first version shows the name and version number and the second version has the possibility to select which additional columns you wish to see.

/*
 * Paste this file into Firefox's JavaScript Console and evaluate it to display the installed extensions and themes - dickvl@kb.mozillazine.org
*/
(function () {
var Cc = Components.classes;
var Ci = Components.interfaces;
var EMP = "http://www.mozilla.org/2004/em-rdf#";
var rv = {}; rv.ext = []; rv.the = [];

var ds =
    Cc["@mozilla.org/extensions/manager;1"].
    getService(Ci.nsIExtensionManager).
    datasource;
var rdf =
    Cc["@mozilla.org/rdf/rdf-service;1"].
    getService(Ci.nsIRDFService);
var elts =
    Cc["@mozilla.org/rdf/container-utils;1"].
    getService(Ci.nsIRDFContainerUtils).
    MakeSeq(ds, rdf.GetResource("urn:mozilla:item:root")).
    GetElements();

function rdfGS(elt,res){
 try{
     return(ds.GetTarget(elt,rdf.GetResource(EMP+res),true).QueryInterface(Ci.nsIRDFLiteral).Value);
 } catch(e){return("")}
}

function makeRV(elt,rv){
 var nam = rdfGS(elt,"name");
 var ver = rdfGS(elt,"version");
 var dis = rdfGS(elt,"isDisabled");
 var hom = rdfGS(elt,"homepageURL");
 rv.push({name:nam,id:elt.Value.replace(/^urn:mozilla:item:/,""),vers:ver,dis:dis,home:hom});
return(rv);
}

function makeLIST(rv){
 var list="",i,RV;
 for (i=0;RV=rv[i];i++) {
  var name = RV.name;
  var vers = RV.vers;
  var disab = (RV.dis=="true")?"(disabled)":"";
  var home = RV.home;
  list+="<a href=" + home + "><span>" + name + " </span><span> " + vers + " </span></a><span> " + disab + " </span></br>";
 }
return(list);
}

while (elts.hasMoreElements()) {
 var elt = elts.getNext().QueryInterface(Ci.nsIRDFResource);
 if (ds.HasAssertion(elt,rdf.GetResource(EMP+"type"),rdf.GetIntLiteral(2),true)){
  makeRV(elt,rv.ext); 
 }
 if (ds.HasAssertion(elt,rdf.GetResource(EMP+"type"),rdf.GetIntLiteral(4),true)){
  makeRV(elt,rv.the);
 }
}

var extList="<p><b>Extensions:</b><br>"+makeLIST(rv.ext)+"</p>";
var theList="<p><b>Themes:</b><br>"+makeLIST(rv.the)+"</p>";

window.open('data:text/html,
<html><head>
<meta http-equiv=content-type" content="text/html; charset=ISO-8859-1">
<title>Mozilla Extensions</title>
</head><body style="margin: 1em 3em; background-color: rgb(255, 221, 221);">
' + extList + theList + '
</body></html>',
"", "menubar=yes,toolbar=no,scrollbars=yes,resizable=yes,width=1000,height=600");
})();
/* 
 *To display the installed extensions and themes paste this file into Firefox's JavaScript Console and evaluate it - dickvl@kb.mozillazine.org
*/
(function () {
var Cc = Components.classes;
var Ci = Components.interfaces;
var EMP = "http://www.mozilla.org/2004/em-rdf#";
var EMT = 2; /* Extensions: EMT = 2;  Themes: EMT = 4; */
var rv = {}; rv.ext = []; rv.the = [];

/* columns - 0:space  1:name  2:version  3,4:disabled  5:id  6:description  7:homepage  8:compatible  9:install location */
var THEAD = ["","Name","Version","Disabled","(-)","ID","Description","Home Page","Comp.","Inst.Loc"];
var TCONT = (prompt("Columns:\n\n1:Name\n2:Version\n3:Disabled  4:(U|A)\n5:ID\n6:Description\n7:Home Page\n","1 2 3"));
TCONT=((TCONT==null || TCONT=="")?"1 2 3":TCONT).split(" ");

var ds =
    Cc["@mozilla.org/extensions/manager;1"].
    getService(Ci.nsIExtensionManager).
    datasource;
var rdf =
    Cc["@mozilla.org/rdf/rdf-service;1"].
    getService(Ci.nsIRDFService);
var elts =
    Cc["@mozilla.org/rdf/container-utils;1"].
    getService(Ci.nsIRDFContainerUtils).
    MakeSeq(ds, rdf.GetResource("urn:mozilla:item:root")).
    GetElements();

function rdfGS(elt,res){
 try{
  return(ds.GetTarget(elt,rdf.GetResource(EMP+res),true).QueryInterface(Ci.nsIRDFLiteral).Value);
 }catch(e){return("")}
}

function makeTD(rv){
var i,j,DV,RV,TC,td="";
for (i=0;RV=rv[i];i++) {
  td+="<tr>";
 for(j=0;TC=TCONT[j];j++){
  switch(parseInt(TC)){
   case 1: DV=RV.name;break;
   case 2: DV=RV.vers;break;
   case 3: DV=(RV.dis=="true")?"(disabled)":"";break;
   case 4: DV=((RV.adis=="true")?"(A)":"")+((RV.udis=="true")?"(U)":"");break;
   case 5: DV=RV.id;break;
   case 6: DV=RV.descr;break;
   case 7: DV=RV.home;break;
   case 8: DV=(RV.comp=="true")?"Yes":((RV.comp=="false")?"No":"");break;
   case 9: DV=RV.inst;break;
   default: DV="";break;
  } td+="<td>"+DV+"</td>";
 }
 td+="</tr>";
}
return(td);
}

function makeRV(elt,rv){
 var nam = rdfGS(elt,"name");
 var ver = rdfGS(elt,"version");
 var des = rdfGS(elt,"description");
 var dis = rdfGS(elt,"isDisabled");
 var ads = rdfGS(elt,"appDisabled");
 var uds = rdfGS(elt,"userDisabled");
 var hom = rdfGS(elt,"homepageURL");
 var com = rdfGS(elt,"compatible");
 var ins = rdfGS(elt,"installLocation");
 rv.push({name:nam,id:elt.Value.replace(/^urn:mozilla:item:/,""),vers:ver,descr:des,adis:ads,udis:uds,home:hom,dis:dis,inst:ins,comp:com});
return(rv);
}

while (elts.hasMoreElements()){
 var elt = elts.getNext().QueryInterface(Ci.nsIRDFResource);
 if(isExt=ds.HasAssertion(elt,rdf.GetResource(EMP+"type"),rdf.GetIntLiteral(2),true)){
  makeRV(elt,rv.ext);
 }
 if(isExt=ds.HasAssertion(elt,rdf.GetResource(EMP+"type"),rdf.GetIntLiteral(4),true)){
  makeRV(elt,rv.the);
 }
}

var thead="";
for(j=0;TC=TCONT[j];j++){thead+="<td><b>"+(THEAD[(TC<THEAD.length)?TC:0])+"</b></td>";}

var tdivE = makeTD(rv.ext);
var tdivT = makeTD(rv.the);

function TD(string) {return (string.length < 2) ? "0" + string : string ;}
function FD(number){return (number < 1000) ? number + 2000 : number;}

var now = new Date();
var hrs = TD(now.getHours() + "");
var min = TD(now.getMinutes() + "");
var sec = TD(now.getSeconds() + "");

var timeValue = " | At  " + hrs + ":" + min + ":" + sec;
var days = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
var months = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();

var today =  "On " + days[now.getDay()] + ", " + date + " " + months[now.getMonth()] + " " +    (FD(now.getYear())) + timeValue;

function makeTABLE(label,thead,tcont){
return('<p><b>'+label+':</b><br>
<table style="empty-cells: show; background-color: rgb(221, 255, 221);" border="1" cellspacing="0">
<tbody><tr style="background-color: rgb(204, 204, 255);">'+thead+'</tr>'+
tcont+'</tbody></table></p>');
}

window.open('data:text/html,
<html><head>
<meta http-equiv=content-type" content="text/html; charset=ISO-8859-1">
<title>Mozilla Extensions & Themes</title>
<style type="text/css">
 td {
  font-family: "Trebuchet MS", Arial, Verdana, Sans-Serif;
  font-size: 85%;
  padding: 1px 2px 1px 2px;
}
</style>
</head><body style="margin: 1em 3em; background-color: rgb(255, 221, 221);">
<b>MOZILLA ADD-ONS INFORMATION (by dickvl@kb.mozillazine.org)</b><p>'+today+'</p>'+
makeTABLE("Extensions",thead,tdivE) + makeTABLE("Themes",thead,tdivT)+'
</body></html>',"", "menubar=yes,toolbar=no,resizable=yes,scrollbars=yes,width=1000,height=700");
})();

Printing Passwords

Here is an enhanced version of the Password printing code from Password Manager to show all the fields, may be helpful for troubleshooting issues.

/*
 * Paste this file into Firefox's JavaScript Console and evaluate it to display the saved names and passwords - dickvl@kb.mozillazine.org
*/

(function(){
function tdigs(str) {return (str.length < 2) ? "0" + str : str;}
function fdigs(num){return (num < 1000) ? num + 2000 : num;}

var now = new Date();
var hrs = tdigs(now.getHours() + "") ;
var mins = tdigs(now.getMinutes() + "") ;
var secs = tdigs(now.getSeconds() + "") ;

var tValue = " | At  " + hrs + ":" + mins + ":" + secs;
var days = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
var mons = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();

var today =  "On " + days[now.getDay()] + ", " + date + " " + mons[now.getMonth()] + " " +    (fdigs(now.getYear())) + tValue ;

var Cc = Components.classes;
var Ci = Components.interfaces;

netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");

var tokendb = Cc["@mozilla.org/security/pk11tokendb;1"]
                .createInstance(Ci.nsIPK11TokenDB);
var token = tokendb.getInternalKeyToken();

try {token.login(true);} catch (e) {}

if (token.isLoggedIn()) {
 var passwordmanager = Cc["@mozilla.org/login-manager;1"]
                       .getService(Ci.nsILoginManager);
 var names="",signons = passwordmanager.getAllLogins({});

 for (i=0;i<signons.length;i++) {
  try {
   var host = signons[i].hostname;
   var realm = signons[i].httpRealm;
   var user = signons[i].username;
   var usrf = signons[i].usernameField;
   var psw = signons[i].password;
   var pswf = signons[i].passwordField;
   var surl = signons[i].formSubmitURL;
   if (user == ""){ user = "<br>"; }
   names+="<tr>\n<td>"+host+"</td>\n<td>"+realm+" </td>\n<td>"+usrf+"</td>\n<td>"+user+"</td>\n<td>"+pswf+"</td>\n<td>"+psw+"</td>\n<td>"+surl+"</td>\n</tr>\n";
   } catch(e) {}
 }

 void(window.open('data:text/html,
<html><head>
<meta http-equiv=content-type" content="text/html; charset=ISO-8859-1">

<title>Exported Mozilla Passwords</title>
<style type="text/css">
 td {
  font-family: "Trebuchet MS", Arial, Helvetica, Geneva, Verdana, Sans-Serif;
  font-size: 85%;
  padding: 1px 2px 1px 2px;
}
</style>
</head><body style="margin: 1em 3em; background-color: rgb(255, 221, 221);">
<b>MOZILLA PASSWORD INFORMATION</b>
<p>Produced by <i>Pasting Code in the "Tools > Error Console: Code field"</i> (by "ernie" - Andrew Poth - Ed Mullen - adapted by dickvl@kb.mozillazine.org to run in the Error Console)<br>'+today+
'</p><p>
<table style="empty-cells: show; background-color: rgb(221, 255, 221);" border="1" cellspacing="0">
<tbody><tr style="background-color: rgb(204, 204, 255);">
<td>
<b>Host</b>
</td>
<td>
<b>Realm</b>
</td>
<td>
<b>User Field</b>
</td>
<td>
<b>User Name</b>
</td>
<td>
<b>Psw Field</b>
</td>
<td>
<b>Password</b>
</td>
<td>
<b>Submit URL</b>
</td>
</tr>'+names+'</tbody></table>
</p></body></html>',"","menubar=yes,resizable=yes,scrollbars=yes,width=1000,height:600"));
}
})();

Private Browsing

Here is a simple extension that hides and disables the "Tools -> Start Private Browsing" entry and the "Tools > Clear Recent History" entry in Firefox 3.5/6.
The extension will hide the menu entries, but not the line in "Tools > Options" to start PB mode automatically, so you need to add code to userChrome.css as well (the code also hides the menu entries if the extension is disabled). It is still possible to set the related pref browser.privatebrowsing.autostart on the about:config page and to clear the cache via "Tools -> Options -> Advanced -> Network" and to clear history in the Library and History sidebar. See also [1]

You also need to add code to userChrome.css below the @namespace line.
See http://kb.mozillazine.org/Editing_configuration#How_to_edit_configuration_files

@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");

/* Hide PB and Sanatize item in Tools menu */
#sanitizeSeparator, #privateBrowsingItem, #sanitizeItem {display:none!important;}

/* Hide Autostart PB in Options > Privacy */
#privateBrowsingAutoStart {display:none!important;}

Copy and paste the full DATA code in the location bar and save the file as pbdisable.xpi
You can install the extension via "File > Open File" or by dragging the file in a Firefox window.
You can move the extensions folder (pbdisable@mozillazine.org) from the extensions folder in the Profile Folder to the %AppData%\Mozilla\extensions\{ec8030f7-c20a-464f-9b0e-13a3a9e97384} folder to make the extension work in all Firefox profiles.

data:application/octet-stream;base64,
UEsDBBQAAAAIAIIoOTz7YFT+VQAAAI8AAAAPABUAY2hyb21lLm1hbmlmZXN0VVQJAAMzGF1LMxhd
S1V4BADoA2QAS87PK0nNK+EsSErJLE5MyknlzEosskrOKMrPTdWHC+oBBRX1kyFq9Xm5eLnyy1KL
chIrOSEqrfT1k4ryy4tTi+CKoHy9itIchC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AACkgYsCAABjaHJvbWUvcGJkaXNhYmxlLmphclVUBQAD
hyFdS1V4AABQSwUGAAAAAAQABAAhAQAAzgUAAAAA

I use this code to remove menu entries and disable shortcut keys in the extension.:

 void((E=window.document.getElementById('key_privatebrowsing')).removeAttribute('key'));
 void(E.removeAttribute('modifiers'));void(E.removeAttribute('command')); 

You can use the DOM Inspector to find the ID of a menu entry if you want to disable other menu entries.

I use this code on Linux to disable some shortcuts that I want to use in Prefbar or that are otherwise dangerous (Ctr+Q to Quit Firefox is too close to Ctrl+W).

void((E=window.document.getElementById('key_closeWindow')).removeAttribute('key'));
void(E.removeAttribute('modifiers'));void(E.removeAttribute('command'));
void((E=window.document.getElementById('key_quitApplication')).removeAttribute('key'));
void(E.removeAttribute('modifiers'));void(E.removeAttribute('command'));
void((E=window.document.getElementById('key_privatebrowsing')).removeAttribute('key'));
void(E.removeAttribute('modifiers'));void(E.removeAttribute('command'));
void((E=window.document.getElementById('key_openDownloads')).removeAttribute('key'));
void(E.removeAttribute('modifiers'));void(E.removeAttribute('command'));
void((E=window.document.getElementById('key_undoCloseWindow')).removeAttribute('key'));
void(E.removeAttribute('modifiers'));void(E.removeAttribute('command'));
void((E=window.document.getElementById('manBookmarkKb')).removeAttribute('key'));
void(E.removeAttribute('modifiers'));void(E.removeAttribute('command'));

TabVisited

In Firefox 3.6 it is no longer possible to use the selected attribute to style unvisited and visited tabs with code in userChrome.css [2], https://bugzilla.mozilla.org/show_bug.cgi?id=487242]
I have attached an extension TabVisited to bug 487242 to add a visited attribute to tabs that have been visited that can be used until bug 487242 gets fixed.
Tabs that haven't been visited do not have that attribute. The currently selected attribute has a selected and a visited attribute.
See comment #c0 [3] (Description) for some coding examples.

Copy and paste the full DATA code in the location bar and save the file as tabvisited.xpi
You can install the extension via File > Open File or by dragging the file in a Firefox window.
You can move the extensions folder (tabvisited@mozillazine.org) from the extensions folder in the Profile Folder to the %AppData%\Mozilla\extensions\{ec8030f7-c20a-464f-9b0e-13a3a9e97384} folder to make the extension work in all Firefox profiles (that includes nightly Minefield and Namoroka builds). The maxVersion is set to 4.*. This version works for SeaMonkey 2 as well.

data:application/octet-stream;base64,
UEsDBBQAAAAIAAoZPDwjY3igZAAAAPAAAAAPABUAY2hyb21lLm1hbmlmZXN0VVQJAAOU8WBLlPFg
S1V4BADoA2QAlc0xCoAwDIXhuQUP4QWa3dvEGrSiDcRY9fYKSuvg4pjHxx/PUSmqUWxTWIJSZ0aU
xg/CM0FZ3bXW4G8Nla0sJ5IJD3PTBqAV3haSjJ7b7etUUClm93py0Y9wxBR6VC7pvPyOn1BLAwQU
AAAACABLGTw8w9IgbrIBAADkAwAACwAVAGluc3RhbGwucmRmVVQJAAMN8mBLDfJgS1V4BADoA2QA
pZNfb5swFMXfK/U7ePRtm/ljvCQgQrcp6tP20m19N3BJrWKDbCchrfbdByZWWFRNk/oG9/yOfc5F
ZLe9aNAelOatXHuRH3q3+fXV9VV2v7lDgyb12ns0pkuD4HA4+IfYb9U2iJIkCUISEIJVVWN9lIb1
WOobb/KkIP6yifaZNw2zXhKGNAAxGm+84S6UbUCXindmiIBY0e7M2tspmZ5MKZfasKbBgklegzbW
hDIQKa9yw4o919xA9fnEP3MJ40VZMBEOlkxA/pMVDxNuZTtzwGkLeeRHVnTvTq/OMWfnfEQ170Gj
r7stoqslocSa57A7oFTATKvyipdP+8ZibuSQx1ZAx7bw6/5bftpf3aqd0P5r7ea0O8EcO8inDPbR
fsx3GKM7rqBue4SxXfqoM7UF86XrGl6yc9LNRXS36hcoV2Ec1ktckpBhuqA1TooQcBSzmCWQLOMV
/T1fu3UKLh9Om4z90Mqz0RljvZtR//2EnUc2WHCRbCr5SolRGyv/APa9lU9wfEPphCw+hSWtMC1W
gGlFGC6WUGBCoaxpvSgWMftnafJ/pQfsw1tbX7JZMPzF+R9QSwMECgAAAAAAzbR2OwAAAAAAAAAA
AAAAAAcAFQBjaHJvbWUvVVQJAANRrwlLLbAJS1V4BADoA2QAUEsDBBQAAAAIAGk4nDs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ADDfJg
S1V4AABQSwECFwMKAAAAAADNtHY7AAAAAAAAAAAAAAAABwANAAAAAAAAABAA7UGWAgAAY2hyb21l
L1VUBQADUa8JS1V4AABQSwECFwMUAAAACABpOJw7GVaoHGACAADnAgAAFQANAAAAAAAAAAAApIHQ
AgAAY2hyb21lL3RhYnZpc2l0ZWQuamFyVVQFAAMlSjhLVXgAAFBLBQYAAAAABAAEACIBAAB4BQAA
AAA=

TabVisited with CSS code

This version has the CSS code from [4] embedded, so works right "out of the box"!.
Works with Firefox 3 (maxVersion 4.*) and SeaMonkey 2 (maxVersion 2.0+).
Save as tabvisited-1-2-fx-sm.xpi

data:application/octet-stream;base64,
UEsDBBQAAAAIAFsWPDwjY3igZAAAAPAAAAAPABUAY2hyb21lLm1hbmlmZXN0VVQJAAN97WBLfe1g
S1V4BADoA2QAlc0xCoAwDIXhuQUP4QWa3dvEGrSiDcRY9fYKSuvg4pjHxx/PUSmqUWxTWIJSZ0aU
xg/CM0FZ3bXW4G8Nla0sJ5IJD3PTBqAV3haSjJ7b7etUUClm93py0Y9wxBR6VC7pvPyOn1BLAwQU
AAAACAC2Ezw8Mt2e1boBAADUAwAACwAVAGluc3RhbGwucmRmVVQJAAOH6GBLh+hgS1V4BADoA2QA
jZNNb5wwEIbvkfIfXHJra/Aad3dBLGmrKKf2krS5Gxg2VrBBtvcrVf97+TBZNtmqvcHM8+J5xiK5
3ssKbUEbUauVN/OJd51eXlxeJHc3t6jtKbPyHq1t4iDY7Xb+LvRrvQ5mURQFhAaUYl2U2ByU5Xus
zJU3ZGKQJzFZP4uq4n2WEsICkF3wymvPSm7A5Fo0tp0A8aze2JW30Sp2mVgoY3lVYcmVKMHYLoMS
kLEoUsuzrTDCQvHZ4c9CQXdMEgyEYxWXkP7g2cNA992+5vpuA+nMp31vfHft4jji5CsfUSn2YNDX
zRqx5YKyITuFXT7XwG2t00LkT9uqp8aSIx5rCQ1fw8+7b6lbXFnrjTT+ObEp7T5gDw2kwwD9Y3+J
7zBG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