diff --git a/firefox_addon/README.md b/firefox_addon/README.md
index 27b163e..dec9e9d 100644
--- a/firefox_addon/README.md
+++ b/firefox_addon/README.md
@@ -1,4 +1,4 @@
-gPass : global password
+gPass : global Password
=======================
Introduction
diff --git a/firefox_addon/lib/main.js b/firefox_addon/lib/main.js
index f755ca1..2f9b8fd 100644
--- a/firefox_addon/lib/main.js
+++ b/firefox_addon/lib/main.js
@@ -25,6 +25,7 @@ var Hashtable = require("jshashtable-3.0").Hashtable;
// http://code.google.com/p/crypto-js/
var sha256 = require("jssha256").sha256;
var aes = require("jsaes").aes;
+var parseURI = require("parseuri").parseURI;
var prefSet = require("simple-prefs");
// Global document
var doc;
@@ -62,7 +63,8 @@ function on_sumbit()
var fields = form.getElementsByTagName("input");
var my_map = new Hashtable();
- domain = form.ownerDocument.domain;
+ domain = parseURI.parseUri(form.ownerDocument.baseURI);
+ domain = domain["host"];
// Get all
for (i=0; i
+// MIT License
+
+exports.parseURI = {
+
+ parseUri : function (str) {
+ var o = {
+ 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*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/
+ }},
+ 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;
+ }
+};