GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Greasemonkey is one of the most popular Firefox extensions. It is so successful that was emulated natively in Google Chrome, including GM_xmlhttpRequest.
But GM_xmlhttpRequest is incompatible with Multifox. Requests always use default cookies, even in other identity profile, causing error.
I need GM_xmlhttpRequest, can't use XMLHttpRequest.
It is possible to make Multifox compatible with Greasemonkey/GM_xmlhttpRequest?
Probably not, it's a connection originated from Greasemonkey.
Maybe I can check the call stack to find out the exact window.
Maybe a multifox_xmlhttpRequest identical to GM_xmlhttpRequest that can be called by UserScripts?
I must detect status 302 in requests. XMLHttpRequest doesn't do this unless you have chrome privileges, but UserScripts haven't.
EDIT: got it! getBrowser().getAttribute("multifox-dom-identity-id")
Please, a little help: what code I must run to detect which identity profile I'm using THIS window?
I'm close to solving my problem.
I can get identity profile cookies and inject in GM_xmlhttpRequest.
Just missing detect which profile I'm using in the window.
For default identity profile:
var iter = Cc["@mozilla.org/cookiemanager;1"].getService(Ci.nsICookieManager2).getCookiesFromHost("accounts.google.com");
For identity profile 2:
var iter = Cc["@mozilla.org/cookiemanager;1"].getService(Ci.nsICookieManager2).getCookiesFromHost("accounts.google.com.google-com-2.multifox");
For identity profile 3:
var iter = Cc["@mozilla.org/cookiemanager;1"].getService(Ci.nsICookieManager2).getCookiesFromHost("accounts.google.com.google-com-3.multifox");
And so on.
What code I must run to detect which profile I'm using THIS window?
Please try Multifox 3.0 beta (per-tab profiles): https://addons.mozilla.org/en-US/firefox/addon/multifox/#beta-channel [Development Channel]
Profile for a specific tab: