How to use the firefox-profile.prototype function in firefox-profile

To help you get started, we’ve selected a few firefox-profile examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github firefox-devtools / vscode-firefox-debug / src / util / addon.ts View on Github external
try {
				fs.accessSync(manifestPath, fs.R_OK);
			} catch (err) {
				return Promise.reject(`Couldn't read ${manifestPath}`);
			}
			let manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
			return createJetpackXpi(manifest, { addonDir, destDir }).then((xpiPath) => {
				fs.renameSync(xpiPath, destFile);
			});
	}
}

// we perform some Voodoo tricks to extract the private _addonDetails method
// (which uses the _sanitizePref method) from FirefoxProfile
function FirefoxProfileVoodoo() {}
FirefoxProfileVoodoo.prototype._addonDetails = FirefoxProfile.prototype._addonDetails;
FirefoxProfileVoodoo.prototype._sanitizePref = FirefoxProfile.prototype._sanitizePref;
// and now more Voodoo tricks to turn the (blocking) callback-based method
// into a simple synchronous method
function getLegacyAddonId(addonPath: string): string {
	let addonDetails: any;
	let voodoo = new FirefoxProfileVoodoo();
	voodoo._addonDetails(addonPath, result => addonDetails = result);
	return addonDetails.id;
}
github firefox-devtools / vscode-firefox-debug / src / util / addon.ts View on Github external
fs.accessSync(manifestPath, fs.R_OK);
			} catch (err) {
				return Promise.reject(`Couldn't read ${manifestPath}`);
			}
			let manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
			return createJetpackXpi(manifest, { addonDir, destDir }).then((xpiPath) => {
				fs.renameSync(xpiPath, destFile);
			});
	}
}

// we perform some Voodoo tricks to extract the private _addonDetails method
// (which uses the _sanitizePref method) from FirefoxProfile
function FirefoxProfileVoodoo() {}
FirefoxProfileVoodoo.prototype._addonDetails = FirefoxProfile.prototype._addonDetails;
FirefoxProfileVoodoo.prototype._sanitizePref = FirefoxProfile.prototype._sanitizePref;
// and now more Voodoo tricks to turn the (blocking) callback-based method
// into a simple synchronous method
function getLegacyAddonId(addonPath: string): string {
	let addonDetails: any;
	let voodoo = new FirefoxProfileVoodoo();
	voodoo._addonDetails(addonPath, result => addonDetails = result);
	return addonDetails.id;
}

firefox-profile

firefox profile for selenium WebDriverJs, admc/wd or any other node selenium driver that supports capabilities

MIT
Latest version published 4 months ago

Package Health Score

70 / 100
Full package analysis