Nov 20 2009

Firefox Mobile (Fennec) Greasemonkey Compiler

Friday is code day… So after issuing an update to FireVortex, I spent a few minutes uploading the very simple Greasemonkey Compiler for Firefox Mobile. (see previous post)

The only changes I made over the version by Arantius was appending to the browsers container vs appcontent; updating the em:id target; and default version numbering. I tested out a few random userscripts and it seems everything works well on both the desktop Windows and Linux versions of Firefox Mobile. (I do not own a N900) – installing the extension is another thing. But I can already see a nice need for changing up styles to suite a smaller layout.


Jul 12 2009

Observing Cookie changes in Firefox Extensions

Preferences MDC has an example for setting a “nsPref:changed” observer but I needed to watch some cookies as well for FireVortex. I was unable to find a clear cut example so a slight modification and it seems to work:


function CookieListener(func) {
var cl = Components.classes['@mozilla.org/observer-service;1']
.getService(Components.interfaces.nsIObserverService);

this.register = function() {
cl.addObserver(this, "cookie-changed", false);
};

this.unregister = function unregister() {
if (cl) cl.removeObserver(this,'cookie-changed');
};

this.observe = function(subject, topic, data) {
if (topic == "cookie-changed")
func(subject);
};
}

var myListenerCookie = new CookieListener(
function(subject) {
let cookie = subject.QueryInterface(Components.interfaces.nsICookie);
if (cookie.name == "mycookiename"
|| cookie.host == "mycookiehost.com") {
//update whatever
}
});

myListenerCookie.register();

*EDIT…

found this throws a random Error: Components is not defined
added
if (typeof Components == 'undefined') return;

as a fail-safe… not sure why this is happening…

*DOUBLE EDIT…

my bad… don’t keep the profile/extensions folder under application data open during an update ;)


Feb 21 2009

Removing Cookies in Firefox Extensions

Removing a cookie from an extension…

IS:
Components.classes["@mozilla.org/cookiemanager;1"]
.getService(Components.interfaces.nsICookieManager)
.remove(“forums.vwvortex.com”, “firevortexfavforums”, “/”, false);

INSTEAD OF:
cookieSvc.setCookieString(uri, null, “firevortexfavforums=; domain=forums.vwvortex.com; expires=Thu Jan 01 1970 00:00:01 GMT-0700; path=/”, null);


Feb 5 2009

[beta] FireVortex for FF3.1b2

I have posted a test extension for Firefox 3.1b2, please see the VWVortex Thread (first post) for download details.

-updated all xpath for gecko1.9 dom changes (case sensitive now? or maybe zeroforum html code)
-started to change around the greasemonkey compiler script, added my own API hitch, common functions
-added fistrun and upgrade open in new tab (thanks to session restore tip & on page load from MDC)


Feb 3 2009

FireNICO Is Now Available

Awhile back I had a simple fork of FireVortex running on honda-tech.com (no longer on zeroforum) and nicoclub.com forums. I had forgotten (well maybe no one was using them) but it turns out it I was wrong… so updated for FF3.0 and brought inline with FV.

Anyways, grab FireNICO for NICOClub.com here or check out the forum thread