I’m losing track of all the things I’m supposed to do, so I’ve put up a bug tracker at bugs.userstyles.org. Feel free to report bugs on userstyles and Stylish in there. Before putting in crazy feature requests, it’s probably best to discuss it in the forum first.
Posted in Blogroll, Stylish | 1 Comment »
There used to be a bug in Gecko where calling removeChild on a node with an event listener attached makes the node lose the event listener. This bug is present in Firefox 2.0, but won’t be in Firefox 3.0. One unexpected result of this bug is that if the user customizes their toolbar, all event listeners on all the toolbar and menu items will be lost, even if the user didn’t do anything to them. The simplest way to get around this is to set the onwhatever attribute on the elements rather than attaching event listeners. This is what the Firefox UI does. However, there are special challenges we face coding from extensions. We’ll often want to not only add new items, but modify the behaviour of existing items that likely already have onwhatever attributes. We could do something like
element.setAttribute("oncommand", element.getAttribute("oncommand") + ";myExtension.foo()");
but that’s terribly ugly and is prone to break if the existing oncommand throws an error or something else changes it.
The best way I can think of to deal with this situation is to have a different event set the event listener. For example, Stylish puts additional items in the View -> Page Style menu. I want to run a function when the Page Style menu opens to create these additional items. I can’t do it with an event listener on Page Style, because that gets wiped when the toolbar’s customized. Page Style’s menupopup already has an onpopupshowing attribute. So what I could do is add onpopupshowing and onpopuphiding attributes to the View menupopup that add and remove my event listener on the Page Style menupopup.
var stylishBrowserOverlay = {
(...)
init: function() {
(...)
var viewMenuPopup = document.getElementById("view-menu").firstChild;
viewMenu.setAttribute("popupshowing", "stylishBrowserOverlay.addPageStyleListener()");
viewMenu.setAttribute("popuphiding", "stylishBrowserOverlay.addPageStyleListener()");
(...)
},
(...)
addPageStyleListener: function() {
document.getElementById("pageStyleMenu").addEventListener("popupshowing", stylishBrowserOverlay.showPageStyleMenu, false);
},
removePageStyleListener: function() {
document.getElementById("pageStyleMenu").removeEventListener("popupshowing", stylishBrowserOverlay.showPageStyleMenu, false);
},
(...)
}
In reality, I just let the bug exist. Customizing the toolbar doesn’t happen very often and doesn’t warrant a hackish solution like this for such minor functionality.
Posted in Extension Development | 2 Comments »
I’ve been fairly busy lately helping out with sumo, the official Firefox Support project. One way or another, I should have more free time within a month, and I intend to make some more changes to userstyles.org. These include finishing off the performance improvements I started, another look at categorization, and super-feeds that provide authors both comments and threads about their styles.
Posted in Blogroll | No Comments »
Stylish 0.5.2 is now available on AMO. 0.5.2 is a bug fix release. It fixes:
- A bug where Stylish didn’t realize that the URL of styles already installed were the same as the new format userstyles.org URLs, which would make it give you the option of installing a style you already had.
- Two bugs relating to previewing styles not being unapplied when you cancel.
Posted in Stylish | No Comments »
Stylish 0.5.1 is now available on AMO. This fixes some bugs introduced in Stylish 0.5 and adds locales for SeaMonkey/Mozilla Suite (I forgot to update a configuration file).
Stylish (in general, not this version in particular) is more or less feature complete now. I say that because I can’t really think of anything else major that would be worth putting in it. Looking forward to Stylish 0.6, the plan is basically to clean up and remove unused features, TBD at a later date. I may also start dropping support for some applications, possibly Firefox 1.5, Thunderbird 1.5, and non-toolkit Mozilla Suite/SeaMonkey to be able to remove workarounds and extra configuration that they require, and also to make use of platform features newer versions allow, such as SQLite. These decisions will be made by popular demand, conducting polls in the forum and looking at website stats.
Of course, none of this is going to happen soon because I’m in the “fix the site” mode at the moment.
Posted in Stylish | 3 Comments »
While Googling around I found that someone else once made an extension called YesScript. It’s a single blog entry by a guy named Zhang Ling, and the install link is broken. It looks like his YesScript worked just like my YesScript, except his additionally has a global on/off button. I’ve tried to contact him, but got no reply. From a Babelfish translation:
Considered the company intellectual property rights related rules and regulations, YesScript is unable to put to male on-line downloading, at present only can open for the internal staff uses.
Too bad I had to spend time to create it myself because of IBM’s IP rights. Oh well, now we have a free YesScript. Normally, I’d be of the opinion that it’s bad form to name an extension the same as another one, but since the other doesn’t seem to be active or ever posted anywhere, I think I’ll be fine.
Posted in yesscript | 2 Comments »
I’ve added a new feature to userstyles.org that’ll hopefully get a bit of cash flowing towards style writers. Users now have the option to provide an e-mail address for a Paypal account. Users who do this will have a third (along with reviews and forum posts) form of feedback on their styles’ pages - donation via PayPal. Speaking from personal experience, having users caring enough to send money for a free service is a great motivator.
Posted in Blogroll | 1 Comment »
I’ve released YesScript 1.1. YesScript is a JavaScript blacklist, allowing you to specify which sites aren’t allowed to run JavaScript.
This version:
- Fixes a bug where if the user had never used security policies, the extension wouldn’t work.
- Fixes a bug where the manage dialog would appear blank.
- Adds support for IDN domains
- Adds French, Hebrew, Hungarian, Italian, Japanese, Korean, Polish, Brazilian Portuguese, and Traditional Chinese localizations thanks to the people from Babelzilla.
Please go submit reviews of YesScript on AMO, and feel free to post here or mail me with any questions or comments.
Posted in yesscript | 4 Comments »
IDL
The second last word is the type of the objects in the array.
void getArray(out unsigned long count, [array, size_is(count), retval] out string retv);
XPCOM
getArray: function(count) {
var returnValue = ["foo", "bar", "baz"];
count.value = returnValue.size;
return returnValue;
}
Calling code
var xpcom = Components.classes["@example.com;1"].getService(Components.interfaces.nsIExample);
var array = xpcom.getArray({});
Posted in Extension Development | No Comments »
Stylish 0.5b1 is out, discuss here. The beta is feature complete.
Stylish 0.5 will provide:
- Prettied up, simplified UI
- Search field for installed styles
- Additional functions to help CSS editing, such as data URI insertion and !important-izer
- The ability to post a style to userstyles.org from Stylish
- Integration with other extensions, namely It’s All Text, Rainbow Picker, Split Browser, and DOM Inspector
- Support for SeaMonkey and Songbird
Localization is underway - the beta only includes en-US. In case you’re wondering why there’s a big jump in size since the last version, it’s mostly because of a change in the way it’s packaged, the support for additional apps, and the additional icons. I don’t believe the code has gotten all that much bigger.
I believe this may be the last “big” update of Stylish; there are no features that stand out to me that are missing any more. Future versions will likely be little tweaks and bug fixes, but nothing that takes as long as this version took.
Posted in Stylish | 4 Comments »