// parseUri 1.2.2 // (c) Steven Levithan // MIT License // http://blog.stevenlevithan.com/archives/parseuri function parseUri (str) { var o = parseUri.options, m = o.parser[o.strictMode ? "strict" : "loose"].exec(str), uri = {}, i = 14; while (i--) uri[o.key[i]] = m[i] || ""; uri[o.q.name] = {}; uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) { if ($1) uri[o.q.name][$1] = $2; }); return uri; }; parseUri.options = { strictMode: false, key: ["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"], q: { name: "queryKey", parser: /(?:^|&)([^&=]*)=?([^&]*)/g }, parser: { strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/, loose: /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/ } }; if (!String.prototype.trim) { String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ""); }; } // Array Remove - By John Resig (MIT Licensed) // http://stackoverflow.com/questions/500606/javascript-array-delete-elements Array.prototype.remove = function(from, to) { var rest = this.slice((to || from) + 1 || this.length); this.length = from < 0 ? this.length + from : from; return this.push.apply(this, rest); }; Element.prototype.removeAllChilds = function() { while (this.hasChildNodes()) this.removeChild(this.childNodes[0]); }; function _generate_random(size, symbols) { forbidden = new Array('\\'); var res = ""; while (res.length < size) { a = Math.floor(Math.random() * (symbols.length/2)) * 2; diff = symbols[a+1] - symbols[a]; r = Math.floor(Math.random()*diff); if (isNaN(r+symbols[a])) continue; character = String.fromCharCode(r + symbols[a]); forbid = false; for (var j=0; j if (target_url[0] == "*") target_url = "." + target_url; try { if (cur_url.match(target_url)) { window.scrollTo(0, url_elem.offsetTop); break; } } /* Forgive re errors */ catch(error) { //console.log(error); } } } input = document.getElementById("master_key"); input.value = ""; update_stats(); } function update_master_key(warning_unciphered) { user = select_widget.options[select_widget.selectedIndex].value; if (user != current_user) { current_user = user; document.title = "gPass - " + current_user; list_all_entries(current_user); addon_address = document.getElementById("addon_address"); addon_address.removeAllChilds(); addon_address.appendChild(document.createTextNode("Current addon address is : " + server_url + current_user)); warning_unciphered = false; } current_mkey = document.getElementById("master_key").value; if (current_mkey != "") { for(i=0; i\n"; for(i=0; i\n"; text += "\t\t\n"; text += "\t\t", "]]\\>", "g") + "]]>\n"; text += "\t\n" } text += "\n"; text_link = makeText(text); link.href = text_link; link.style.display = "inline"; link.style.visibility = "visible"; alert_msg = "Click on download link to get all current unciphered passwords\n\n"; alert_msg += "\"]]>\" sequence has been replaced by \"]]\\>\""; alert(alert_msg); }