You should pass your arguments in the URL of the tab you're opening, that's definitely the easiest way.
openTab("chromeTab", { chromePage: "chrome://yourext/content/foo.html?foo=bar" });
Here's a routine you can use to easily map the current URI's parameters to a javascript dictionary:
/**
* Takes the <b>entire</b> query string and returns an object whose keys are the
* parameter names and values are corresponding values.
* @param aStr The entire query string
* @return An object that holds the decoded data
*/
function decodeUrlParameters(aStr) {
let params = {};
let i = aStr.indexOf("?");
if (i >= 0) {
let query = aStr.substring(i+1, aStr.length);
let keyVals = query.split("&");
for each (let [, keyVal] in Iterator(keyVals)) {
let [key, val] = keyVal.split("=");
val = decodeURIComponent(val);
params[key] = val;
}
}
return params;
}
(warning: this is mozilla-specific javascript)