twitter/nicolagreco
github/nicola
me@nicola.io
write apps in the editor
function veryImportantFunc () {
// ...
console.log("test 2 a", a)
// ...
}
.square {
color: #ff0;
}
.square .img {
border: 1px solid;
}
<link rel="stylesheet"
href="/style_1_test.css">
<link rel="stylesheet"
href="/style_final.css">
var nicola = require('nicola')
describe('Nicola', function() {
it('should say hi', function() {
.square {
color: #ff0;
.img {
border: 1px solid;
}
}
<link rel="stylesheet"
href="/asset.min.css?timestamp=235">
to start the Browser Console
devtools.debugger.remote-enabled = true
devtools.debugger.log: true
var FirefoxClient = require("firefox-client");
var client = new FirefoxClient();
client.connect(8081, function() {
client.listTabs(function(err, tabs) {
tabs.forEach(function(tab,i) {
console.log(i+1, tab.url)
})
});
});
var FirefoxClient = require("firefox-client");
var client = new FirefoxClient();
client.connect(8000, function() {
client.getWebapps(function(err, webapps) {
webapps.getInstalledApps(function(err, apps) {
apps.forEach(function(app,i) {
console.log(i+1, app.name);
});
});
});
});
Each package
$ fx-ports
TYPE PORT PID RELEASE
Firefox OS Simulator 8000 3052 2.2.0.0-prerelease
Firefox Desktop 8080 3072 35.0
$ fx-ports --b2g --release 2.1
$ fx-ports --json
var Ports = require('fx-ports');
Ports({b2g: true}, function(err, instances) {
// ...
console.log(instances);
})
$ fxos-start
Firefox Simulator 2.2 started on port 8000 3317
$ fxos-start --verbose --release 2.1
$ fxos-start --bin <b2g-bin> --profile <profile>
$ fxos-start --exit --force
var Start = require('fxos-start');
Start({port: 8000, connect: true}, function(err, sim) {
// ...
sim.client.disconnect();
})
$ fxos-simulators
RELEASE BIN
2.1 .../fxos_2_1_simulator@mozilla.org/b2g/B2G.app/Contents/MacOS/b2g-bin
2.2 .../fxos_2_2_simulator@mozilla.org/b2g/B2G.app/Contents/MacOS/b2g-bin
$ fxos-simulators --json --release 2.1
var Simulators = require('fxos-start');
Simulators({release:'2.1'}, function(err, sim_paths) {
console.log(sim_paths)
})
var Connect = require('fxos-connect');
Connect(function(err, sim) {
});
Connect({
port: 8080,
release:
})
.then(function(sim) {})
.done();
var Connect = require('fxos-connect');
var FindApp = require('fxos-findapp');
Connect(function(err, sim) {
FindApp({client: sim.client, manifestURL: manif}, function(err, app) {
app.Console.evaluateJS("alert(1)");
})
})
$ fxos-deploy ./manifest.webapp
$ fxos-deploy ./manifest.webapp --port 8081
$ fxos-deploy ./manifest.webapp --release 8081
$ fxos-deploy ./manifest.webapp --zip build/app.zip
var Deploy = require('fxos-deploy');
Connect(function(err, sim) {
Deploy({
manifestURL:"./manifest.webapp",
zip: "./build/app.zip",
client: sim.client
}, function(err, appId) {
sim.client.disconnect();
})
})
var Deploy = require('fxos-deploy/command');
Deploy({
manifestURL:"./manifest.webapp",
zip: "./build/app.zip",
client: sim.client
}, function(err, result) {
// {value: appId, client: FXClient}
}, function(err, appId) {
console.log(appId)
})
or the ANTI-WebIDE
gulp.task('deploy', ['zip'], function(cb) {
deploy({
exit: true,
manifestURL:'./src/manifest.webapp',
zip:'./build/app.zip'
}, null, cb);
});
gulp.task('reloadcss', function(cb) {
reloadcss({
manifestURL:'./src/manifest.webapp',
exit:true
}, null, cb);
});
gulp.task('watch', function() {
gulp.watch(paths.build, ['deploy']);
gulp.watch(paths.css, ['reloadcss']);
});