Simple Firefox automation addon for anything between SlimerJS and GreaseMonkey https://addons.mozilla.org/en-US/firefox/addon/zombie-navigator/
BM-2cWimYg96o7rdmFy99U5RMdQGpXrx75NCE 536fbbf96c Fix a build issue | vor 9 Jahren | |
---|---|---|
bin | vor 9 Jahren | |
branding | vor 9 Jahren | |
demo | vor 9 Jahren | |
jsdoc | vor 9 Jahren | |
src | vor 9 Jahren | |
.gitignore | vor 9 Jahren | |
LICENSE | vor 9 Jahren | |
Makefile | vor 9 Jahren | |
README.markdown | vor 9 Jahren | |
archive.sh | vor 9 Jahren | |
build-docs.sh | vor 9 Jahren | |
build-icon.sh | vor 9 Jahren | |
build.sh | vor 9 Jahren | |
calc-size.sh | vor 9 Jahren | |
demo-headless.sh | vor 9 Jahren | |
headless-run.sh | vor 9 Jahren | |
list-builds.sh | vor 9 Jahren | |
package.json | vor 9 Jahren | |
run.sh | vor 9 Jahren | |
save-archive.sh | vor 9 Jahren | |
show-required.sh | vor 9 Jahren | |
update-data.sh | vor 9 Jahren | |
validate.sh | vor 9 Jahren | |
version_info | vor 9 Jahren |
Free Software browser automation product
This is currently part of the DesktopD Project.
Good solutions to web automation have always been desired. In Mozilla world, SlimerJS (similar to PhantomJS) exists but it is strictly not Firefox (but a different XUL application) and that limit its possibilities. Selenium doesn't catch up with latest Firefox and it also requires a lot of codes outside Firefox.
This addon tries to improve this situation. It is a pure-Firefox web automation product that is Free Software. When Firefox works, this addon should also work. So it can, being very lightweight, automate most to all Firefox-related use cases. There are many many Firefox-based or Firefox-embedded products in the world. We can now use this addon to run testsuites on these products without modification. In theory we can, and if not, it's a bug. (Though this is Firefox 38+)
With the addon you can automate Firefox (or derivatives) with a single script file you like. We call such a script a "Zombie script" and Zombie scripts use the "Zombie API" to do their jobs. The Zombie API is documented inside the addon but this is how it looks like:
'use strict';
const {delay, run} = require('zombie/async');
const {console} = require('zombie/zombie');
run(function* () {
const {openWindow, openPrivateWindow} = require('zombie/webbrowser');
try {
let window1 = yield openWindow('about:');
console.log(window1.uri);
yield delay(5); // sleep for 5 seconds
let promise = window1.runScript(uri => {
location.href = uri;
return 42;
}, 'about:buildconfig');
yield window1.waitForReload();
console.log((yield promise), window1.uri);
yield delay(10.5); // sleep for 10.5 seconds
yield window1.close();
console.log('closed');
} catch (e) {
console.error('Error:', e);
}
});
Command line (GNU/Linux):
$ ZOMBIE_NAVIGATOR_SCRIPT_PATH=<path_to_script> firefox
Command line (Apple OS/X):
$ ZOMBIE_NAVIGATOR_SCRIPT_PATH=<path_to_script> /Application/Firefox.app/Contents/MacOS/firefox
For pseudo-headlessness, Xvfb is supported. Use like this:
$ ZOMBIE_NAVIGATOR_SCRIPT_PATH=<path_to_script> xvfb-run firefox
A script can now most of times shut down Firefox if the user (if any) does not open any tabs. This feature is getting improved, but is incomplete. So please expect windows not closed properly in some cases.
Though this addon is simple, it is similar to SlimerJS. But this is a Firefox addon, like Greasemonkey, and not a standalone application. So it can easily be used to run automated tests with existing Firefox profiles (with your favorite addons installed). That makes it more useful inside an organization.
This addon is designed to change as little of Firefox as possible while it tries to make clear what the script is doing.
This addon is not a server-side application, but for maximum software freedom in case embedded in a SaaS product, we license the addon under the GNU AGPL.
A simple Firefox automation addon
src/
The addon source codebranding/
Branding source code (artworks)jsdoc/
JSDoc-based API documentation source code (experimental)run.sh
Run the addon off the source tree (requires non-release non-beta Firefox due to signing requirement)LICENSE
The GNU Affero General Public License, version 3Firefox (or equivalent) 38+ is required.
jpm
(install with $ make npm
)JSDoc
for API documentation (install with $ make npm
)advzip
utility) for a smaller file size ($ apt-get install advancecomp
on debian-based systems)/bin/sh
, which is not necessarily GNU bash.)$ make npm
(note: huge dependencies)zopflipng
from Google: $ make zopflipng
(please run if you don't have one installed)$ make
$ make docs
$ make archive
$ make icon
about:addon
page (simple-script
module in the SDK)about:addon
page??npm
and semver.org
)We named this program "Zombie Navigator" because it effectively turns Firefox into an automated "zombie" web browser. "Zombie scripts", which run inside a secure sandbox navigate Firefox!
The icon says "Web Browser" in Arabic. Just that. Maybe too simple. But we do not invest much in visual design.
Firefox is a registered trademark of the Mozilla Foundation. The term "Firefox" in this product, however, may also mean rebranded products derived from the official Firefox.
~
for prereleases (compatible with AMO)Copyright © 2015 Zombie Navigator Developers
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses/.
The GNU Affero General Public License (GNU AGPL for short) is included under the file name 'LICENSE'