diff --git a/chrome.manifest b/chrome.manifest
new file mode 100644
index 0000000..aca789f
--- /dev/null
+++ b/chrome.manifest
@@ -0,0 +1,6 @@
+content yourls-shortener chrome/content/
+content yourls-shortener chrome/content/ contentaccessible=yes
+overlay chrome://browser/content/browser.xul chrome://yourls-shortener/content/browser.xul
+locale yourls-shortener en-US locale/en-US/
+skin yourls-shortener classic/1.0 skin/
+style chrome://global/content/customizeToolbar.xul chrome://yourls-shortener/skin/skin.css
\ No newline at end of file
diff --git a/chrome/content/browser.xul b/chrome/content/browser.xul
new file mode 100644
index 0000000..04d97c8
--- /dev/null
+++ b/chrome/content/browser.xul
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/chrome/content/options.xul b/chrome/content/options.xul
new file mode 100644
index 0000000..b5d2401
--- /dev/null
+++ b/chrome/content/options.xul
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/chrome/content/yourlsshortener.js b/chrome/content/yourlsshortener.js
new file mode 100644
index 0000000..294c6ef
--- /dev/null
+++ b/chrome/content/yourlsshortener.js
@@ -0,0 +1,76 @@
+var YOURLSshortener = function () {
+ var prefManager = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
+ return {
+ gohome : function () {
+ var api = prefManager.getCharPref("extensions.yourls-shortener.api");
+ if (api.substr(-1) != '/')
+ api += '/';
+ window.open(api + "admin/");
+ return;
+ },
+ run : function (long) {
+ if (!long)
+ {
+ alert ("lost my URL!?");
+ return;
+ }
+
+ var error = null;
+ var api = prefManager.getCharPref("extensions.yourls-shortener.api");
+ if (api.substr(-1) != '/')
+ api += '/';
+ api += "yourls-api.php";
+
+ if (api && api != 'http://yoursite/')
+ {
+ try
+ {
+ var params = 'action=shorturl&format=simple&url=' + long + '&signature=' + prefManager.getCharPref("extensions.yourls-shortener.signature");
+
+ if (prefManager.getBoolPref("extensions.yourls-shortener.askforkey"))
+ {
+ var sel = "";
+ try
+ {
+ sel = content.getSelection() + "";
+ }
+ catch (e) {}
+
+ var key = prompt("Type your keyword here (leave empty to generate)", sel.toLowerCase ());
+ if (key)
+ params += '&keyword=' + key;
+ }
+
+ var request = new XMLHttpRequest();
+ request.open("POST", api, false);
+ request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
+ request.setRequestHeader("Content-length", params.length);
+ request.setRequestHeader("Connection", "close");
+ request.send(params);
+ if (request.status == 200 || request.status == 201)
+ {
+ if ()
+ {
+ alert ('Your shorten URL:\n' + request.responseText);
+ return;
+ }
+ else
+ error = "Shorten failed.. Maybe invalid key!?"
+ }
+ else
+ error = "API returned crap!";
+ }
+ catch (e)
+ {
+ error = "Failed to start XMLHttpRequest:\n" + e.message;
+ }
+
+ }
+ else
+ error = "No API-URL specified... Check your settings!";
+
+ if (error)
+ alert (error);
+ }
+ };
+}();
\ No newline at end of file
diff --git a/defaults/preferences/prefs.js b/defaults/preferences/prefs.js
new file mode 100644
index 0000000..a86fb87
--- /dev/null
+++ b/defaults/preferences/prefs.js
@@ -0,0 +1,3 @@
+pref("extensions.yourls-shortener.api", "http://yoursite/");
+pref("extensions.yourls-shortener.signature", "123456");
+pref("extensions.yourls-shortener.askforkey", false);
\ No newline at end of file
diff --git a/install.rdf b/install.rdf
new file mode 100644
index 0000000..dd0e425
--- /dev/null
+++ b/install.rdf
@@ -0,0 +1,21 @@
+
+
+
+ yourls-shortener@binfalse.de
+ YOURLS shortener
+ 1.0
+ 2
+ Martin Scharm
+ Shorten URLs with your own YOURLS instance
+ http://binfalse.de/
+ chrome://yourls-shortener/content/options.xul
+ chrome://yourls-shortener/skin/favicon.gif
+
+
+ {ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+ 3.0
+ 4.*
+
+
+
+
diff --git a/locale/en-US/translations.dtd b/locale/en-US/translations.dtd
new file mode 100644
index 0000000..8f70739
--- /dev/null
+++ b/locale/en-US/translations.dtd
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/skin/favicon.gif b/skin/favicon.gif
new file mode 100644
index 0000000..8681802
Binary files /dev/null and b/skin/favicon.gif differ
diff --git a/skin/skin.css b/skin/skin.css
new file mode 100644
index 0000000..f761377
--- /dev/null
+++ b/skin/skin.css
@@ -0,0 +1,6 @@
+#yourls-shortener-toolbar-button, #yourls-shortener-context {
+ list-style-image: url("chrome://yourls-shortener/skin/favicon.gif");
+}
+#yourls-shortener-status-bar-icon {
+ margin: 0 2px;
+}
\ No newline at end of file
diff --git a/yourls-shortener.xpi b/yourls-shortener.xpi
new file mode 100644
index 0000000..7c206c2
Binary files /dev/null and b/yourls-shortener.xpi differ