From d3c324e4b06f0744325798b92e2dd63fa81b520e Mon Sep 17 00:00:00 2001 From: Thibaut Horel Date: Thu, 10 Jul 2014 21:50:43 -0400 Subject: Adding browser key feature, better handling unicode --- firefox-addon/lib/main.js | 5 +++-- firefox-addon/package.json | 7 +++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/firefox-addon/lib/main.js b/firefox-addon/lib/main.js index c5446f2..cc8845e 100644 --- a/firefox-addon/lib/main.js +++ b/firefox-addon/lib/main.js @@ -7,9 +7,10 @@ var XMLHttpRequest = require("sdk/net/xhr").XMLHttpRequest; function log(url, title){ var xhr = new XMLHttpRequest(); xhr.open("POST", prefs.callbackUrl); - var data = "url=" + url; + var data = "url=" + encodeURIComponent(url); data += "&time=" + Date.now(); - data += "&title=" + title; + data += "&title=" + encodeURIComponent(title); + data += "&key=" + encodeURIComponent(prefs.key); xhr.send(data); } diff --git a/firefox-addon/package.json b/firefox-addon/package.json index af6f529..6c89753 100644 --- a/firefox-addon/package.json +++ b/firefox-addon/package.json @@ -12,5 +12,12 @@ "title": "CallbackĀ URL", "description": "URL to be notified on page load/show.", "value": "http://localhost:8080" + }, + { + "name": "key", + "type": "string", + "title": "Browser key", + "description": "Key to identify the browser.", + "value": "firefox" }] } -- cgit v1.2.3-70-g09d2