Chickenfoot 0.9.20070227 released
Minor bug fix that allows trigger scripts to run when the Chickenfoot sidebar is closed.
Minor bug fix that allows trigger scripts to run when the Chickenfoot sidebar is closed.
For the first release of 2007, we have the following treats:
- Triggers can now fire whenever Firefox starts, or whenever a new Firefox window opens. This will be useful for changing Firefox’s chrome, e.g. adding toolbars or menu items from Chickenfoot scripts.
- Chickenfoot scripts can now be triggered from the Firefox command line. Use firefox -cf-run to load and run a Chickenfoot script right after Firefox starts.
- pick() and enter() now simulate onchange events when they change a checkbox, radio button, listbox, or textbox, so Chickenfoot will play better with Javascript-intensive web sites.
- there is now a Stop button on the Chickenfoot sidebar, right next to the Run button. It makes a best effort to stop any running Chickenfoot scripts, although it may not succeed if a script is CPU-bound (because that usually locks up the user interface too).
- fixed a few bugs, such as click(”Next”) not working on Google search results
Chickenfoot now has a new feature called keyword commands, which allows simple scripts to be written without knowing any Javascript syntax. For example, here’s a simple script of commands that takes you to the Chickenfoot page:
go to google.com
type “chickenfoot mit”
search
Keyword commands are still an experimental feature, not enabled by default. You can switch to keyword command execution mode by using the new drop-down menu on the Run button. Keyword commands require Java support in your browser.
The Chickenfoot script editor also now supports Ctrl-Enter to execute the current line in the editor. Ctrl-Enter provides the same behavior as a command line (such as the Javascript command line in the Error Console). Ctrl-Enter works on both Javascript code and keyword command code.
Bug fixes:
Fixes “Components.classes[cid] not found” bug sometimes seen on Windows.
Chickenfoot now uses a new native library to wait for pages to load, which Chickenfoot scripts can now run on Mac and Linux without having to use whenLoaded(). Hooray!
In other news, Chickenfoot now runs on Firefox 1.5.0.7 and Firefox 2 Beta 2.
Other changes:
Last week, Rob and I gave a tech talk at Google about developing JavaScript in Chickenfoot, but we also talked about keyword commands and showed off a number of demos.
The talk is available on Google Video, and
if you expand the Details link on our Google Video page, it brings you to important points in the talk.
Now we also have a dedicated publications page for Chickenfoot so you no longer have to dig through the FAQ to find the papers we’ve written. The new page also has a high-resolution copy of the tech talk in case you want a better look at the demos, but put if you decide to watch it, put some coffee on because it’s a whopping 437MB, so it may take a little while to download.
Fixed some bugs related to packaging Chickenfoot scripts as standalone extensions. Exported Chickenfoot scripts were trying to find the chickenfoot/setup directory in the end-user’s Firefox profile directory. If the end-user had never installed Chickenfoot, this directory would not exist, causing the extension to crash. Also, ==UserScript== tags were not being written back into a script correctly by the packaging tool if the tags did not already exist in the script. Both of these issues are now fixed.
Updated installation page to explain what happened to the TC constructor. The use of TC patterns is no longer supported in Chickenfoot. Using them now requires an additional extension that works in conjunction with Chickenfoot. We are trying to phase out TC patterns in favor of equivalent keyword patterns that will run faster and will not depend on Java.
Can run a trigger by right-clicking on a page and selecting it. Utility scripts, such as Dump current HTML, are not appropriate to install as triggers because they should not run every time a page loads, just when the user needs them (hence the term “utility”). To that end, we have added a context menu that lets you right-click on a page and run any script listed in your Triggers pane. This list includes triggers that aren’t checked in the pane, which makes this feature well-suited to utility scripts.
Chickenfoot scripts can be packaged as standalone Firefox extensions. With the click of a button, you can turn your script into an extension that others can install and use. This feature makes it simple to create a web prototype and share it with friends and colleagues.
New libraries bundled with Chickenfoot: Scriptaculous and Prototype. Prototype is “a JavaScript framework that aims to ease development of dynamic web applications,” and script.aculo.us is a powerful AJAX library that builds on top of it.
Users can define their own script templates. Suppose you want to use Prototype whenever you open a Chickenfoot edit buffer. Now you can create a template with the code include("prototype.js") and set it as your default template so every new buffer contains that code.
Basic table/row/cell patterns are supported. It is possible to locate tables, rows, and cells with the find() command: find("3rd table").find("2nd row").find("5th cell"). So far, we only support ordinals for identifying these elements — we plan to support table/row/cell as keyword patterns in the near future.
New “run selected text” feature lets you run part of a script. You can select any part of your script, right-click, and choose “Run selected” in order to execute it. This is handy if you only want to test a portion of your script.
Recognize “id” keyword pattern. As an alternative to document.getElementById("tableOfContents"), you can use find("tableOfContents id").element instead. Like other Chickenfoot commands, find() traverses subframes when looking for a match, so it can be more convenient than getElementById on sites with many frames, such as Gmail.
Stack traces are printed in the Output pane. When an error is thrown, its stack trace is printed along with the error message to help with debugging.
The core of Chickenfoot no longer requires Java. Previously, users needed the Java plugin for Firefox in order to run Chickenfoot. Now users only need Java if they want to use the extension creation tool or to take advantage of the ability to synchronize scripts with page loads on Microsoft Windows.
A new version of Chickenfoot is out, with several major improvements and bug fixes.
Every Chickenfoot script and trigger now runs in a fresh, private namespace. Formerly, all Chickenfoot scripts shared the same namespace, so it was easy to share global variables between scripts, but scripts could step on each other inadvertently. Most scripts won’t notice this change at all. But if you use global variables to pass information between two scripts, or to store information between subsequent runs of the same script, you’ll have to change your script’s behavior. A new Chickenfoot object, global, provides a place for keeping these global variables. Just prefix the global variables you want to share with global, e.g. global.myVariable, and every script will be able to see them.
The script editor now has multiple tabs, so you can edit multiple scripts at the same time, and use scratch editors for testing and experimentation. The script editor also now has keyboard shortcuts for its toolbar buttons: Ctrl-N for new file, Ctrl-O to open a file, Ctrl-S for save, Ctrl-W for close file. These shortcuts override Firefox’s meaning for these keys only if the focus is in the script editor.
Regular expression support. find() can take a regular expression, which it searches for in the text of the page, e.g. find(/ISBN: \d+/). Parenthesized groups in the regular expression are placed on the Match object as an array called groups.
Image searching. find() can now search for images, e.g. find(”Google image”). Keywords are taken from the image’s ALT text and from text around it in the page.
Other changes:
This release contains no new functionality, but the install package now requires Firefox 1.5 or later, since it doesn’t run on Firefox 1.0.x anymore.