Skip to content

Instantly share code, notes, and snippets.

View uggrock's full-sized avatar

Ilian uggrock

View GitHub Profile
# Node-WebKit CheatSheet
# Download: https://github.com/rogerwang/node-webkit#downloads
# Old Versions: https://github.com/rogerwang/node-webkit/wiki/Downloads-of-old-versions
# Wiki: https://github.com/rogerwang/node-webkit/wiki
# How: https://github.com/rogerwang/node-webkit/wiki/How-node.js-is-integrated-with-chromium
# 1. Run your application.
# https://github.com/rogerwang/node-webkit/wiki/How-to-run-apps
exports.promptDirectorySelector = function promptDirectorySelector(worker) {
console.debug("Opening directory selection dialog...");
try {
var window = require("window/utils").getMostRecentBrowserWindow();
var fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker);
fp.init(window, "Directory Selection", Ci.nsIFilePicker.modeGetFolder);
var result = fp.show();
if (result === Ci.nsIFilePicker.returnOK) {
worker.postMessage({
"command": "selectDirectory",