Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

testcafe-browser-tools

Package Overview
Dependencies
Maintainers
7
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

testcafe-browser-tools - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

lib/utils/flatten-whitespace.js

80

lib/api/get-installations.js

@@ -6,25 +6,37 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
const pinkie_1 = __importDefault(require("pinkie"));
const os_family_1 = __importDefault(require("os-family"));
const which_promise_1 = __importDefault(require("which-promise"));
const lodash_1 = require("lodash");
const fs_exists_promised_1 = __importDefault(require("../utils/fs-exists-promised"));
const exec_1 = require("../utils/exec");
const unquote_1 = __importDefault(require("../utils/unquote"));
const aliases_1 = __importDefault(require("../aliases"));
const MICROSOFT_EDGE_CLASS = 'Microsoft.MicrosoftEdge';
const MICROSOFT_EDGE_KEY_GLOB = `HKCU\\Software\\Classes\\ActivatableClasses\\Package\\${MICROSOFT_EDGE_CLASS}*`;
const BROWSER_COMMANDS_KEY_GLOB = root => `${root}\\Software\\Clients\\StartMenuInternet\\*\\shell\\open\\command`;
const LINE_WRAP = '\r\n';
const DOUBLE_LINE_WRAP = LINE_WRAP + LINE_WRAP;
const REGISTRY_BROWSER_PATH_PROPERTY = '(default)';
const REGISTRY_BROWSER_NAME_PROPERTY = 'PSPath';
const REGISTRY_PROPERTIES_RE = /^(\(default\)|PSPath)\s*:\s*(.*)$/;
const MAX_OUTPUT_WIDTH = 2 ** 31 - 1;
const POWERSHELL_PIPE_SYMBOL = '|';
const GET_REGISTRY_KEY_COMMAND = key => `Get-Item 'Registry::${key}'`;
const GET_BROWSER_PATH_PROPERTY_COMMAND = `Get-ItemProperty -Name '${REGISTRY_BROWSER_PATH_PROPERTY}'`;
const FORMAT_BROWSER_INFO_COMMAND = `Format-List -Property '${REGISTRY_BROWSER_PATH_PROPERTY}','${REGISTRY_BROWSER_NAME_PROPERTY}'`;
const LIMIT_OUTPUT_WIDTH_COMMAND = `Out-String -Width ${MAX_OUTPUT_WIDTH}`;
const GET_REGISTRY_BROWSER_PROPERTIES_COMMAND = key => [
GET_REGISTRY_KEY_COMMAND(key),
GET_BROWSER_PATH_PROPERTY_COMMAND,
FORMAT_BROWSER_INFO_COMMAND,
LIMIT_OUTPUT_WIDTH_COMMAND
].join(POWERSHELL_PIPE_SYMBOL);
// Installation info cache
var installationsCache = null;
async function getRegistrySubTree(regKey) {
let script = `$cp = (chcp | Select-String '\\d+').Matches.Value;
Try
{
chcp 65001;
Get-ChildItem -Path Registry::${regKey} -Recurse;
}
Finally
{
chcp $cp;
}`;
script = script.replace(/\s+/g, ' ');
const command = `powershell.exe -NoLogo -NonInteractive -Command "${script}"`;
return exec_1.exec(command);
async function getRegistryKey(regKeyGlob) {
return exec_1.execPowershell(GET_REGISTRY_KEY_COMMAND(regKeyGlob));
}
async function getRegistryBrowserProperties(regKeyGlob) {
return exec_1.execPowershell(GET_REGISTRY_BROWSER_PROPERTIES_COMMAND(regKeyGlob));
}
// Find installations for different platforms

@@ -45,18 +57,22 @@ async function addInstallation(installations, name, instPath) {

async function detectMicrosoftEdge() {
const regKey = 'HKCU\\Software\\Classes\\ActivatableClasses';
const edgeRe = /^Microsoft\.MicrosoftEdge/m;
const subTree = await getRegistrySubTree(regKey);
return edgeRe.test(subTree) ? aliases_1.default['edge'] : null;
const registryResult = await getRegistryKey(MICROSOFT_EDGE_KEY_GLOB);
if (registryResult.stdout.includes(MICROSOFT_EDGE_CLASS))
return aliases_1.default['edge'];
return null;
}
async function searchInRegistry(registryRoot) {
const installations = {};
const text = await getRegistrySubTree(registryRoot + '\\SOFTWARE\\Clients\\StartMenuInternet');
const re = /\\SOFTWARE\\Clients\\StartMenuInternet\\([^\r\n\\]+)\\shell\\open\s+Name\s+Property[-\s]+command\s+\(default\)\s*:\s*(.+)$/gmi;
let match = re.exec(text);
while (match) {
const name = match[1].replace(/\.exe$/i, '');
const path = match[2].trim().replace(/^"(.*)"$/, '$1').replace(/\\$/, '');
await addInstallation(installations, name, path);
match = re.exec(text);
}
const registryResult = await getRegistryBrowserProperties(BROWSER_COMMANDS_KEY_GLOB(registryRoot));
const data = registryResult.stdout
.split(DOUBLE_LINE_WRAP)
.map(block => block
.split(LINE_WRAP)
.map(line => line.match(REGISTRY_PROPERTIES_RE))
.filter(match => !!match)
.map(match => ({
[match[1]]: unquote_1.default(match[2])
})))
.filter(block => block && block.length)
.map(block => lodash_1.merge(...block));
await Promise.all(data.map(record => addInstallation(installations, record[REGISTRY_BROWSER_NAME_PROPERTY], record[REGISTRY_BROWSER_PATH_PROPERTY])));
return installations;

@@ -77,3 +93,3 @@ }

var stdout = await exec_1.exec('ls "/Applications/" | grep -E "Chrome|Firefox|Opera|Safari|Chromium" | sed -E "s/ /032/"');
await pinkie_1.default.all(stdout
await Promise.all(stdout
.split('\n')

@@ -107,5 +123,5 @@ .filter(fileName => !!fileName)

});
return pinkie_1.default.all(detectionPromises);
return Promise.all(detectionPromises);
});
await pinkie_1.default.all(aliasCheckingPromises);
await Promise.all(aliasCheckingPromises);
return installations;

@@ -167,2 +183,2 @@ }

exports.default = default_1;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0LWluc3RhbGxhdGlvbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvYXBpL2dldC1pbnN0YWxsYXRpb25zLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsb0RBQTZCO0FBQzdCLDBEQUEyQjtBQUMzQixrRUFBa0M7QUFDbEMscUZBQWlEO0FBQ2pELHdDQUFxQztBQUNyQyx5REFBaUM7QUFHakMsMEJBQTBCO0FBQzFCLElBQUksa0JBQWtCLEdBQUcsSUFBSSxDQUFDO0FBRTlCLEtBQUssVUFBVSxrQkFBa0IsQ0FBRSxNQUFNO0lBQ3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BTElBU0VTW25hbWVdO1xuXG4gICAgICAgICAgICBpZiAoIWxpbnV4QmluYXJpZXMpXG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG5cbiAgICAgICAgICAgIHZhciBkZXRlY3Rpb25Qcm9taXNlcyA9IGxpbnV4QmluYXJpZXNcbiAgICAgICAgICAgICAgICAubWFwKGJpbmFyeSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB3aGljaChiaW5hcnkpXG4gICAgICAgICAgICAgICAgICAgICAgICAudGhlbihwYXRoID0+IGFkZEluc3RhbGxhdGlvbihpbnN0YWxsYXRpb25zLCBuYW1lLCBwYXRoKSlcbiAgICAgICAgICAgICAgICAgICAgICAgIC5jYXRjaCgoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gTk9URTogYmluYXJ5IG5vdCBmb3VuZCwganVzdCBkbyBub3RoaW5nXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIHJldHVybiBQcm9taXNlLmFsbChkZXRlY3Rpb25Qcm9taXNlcyk7XG4gICAgICAgIH0pO1xuXG4gICAgYXdhaXQgUHJvbWlzZS5hbGwoYWxpYXNDaGVja2luZ1Byb21pc2VzKTtcblxuICAgIHJldHVybiBpbnN0YWxsYXRpb25zO1xufVxuXG5hc3luYyBmdW5jdGlvbiBmaW5kQnJvd3NlcnMgKCkge1xuICAgIGlmIChPUy53aW4pXG4gICAgICAgIHJldHVybiBhd2FpdCBmaW5kV2luZG93c0Jyb3dzZXJzKCk7XG5cbiAgICBpZiAoT1MubWFjKVxuICAgICAgICByZXR1cm4gYXdhaXQgZmluZE1hY0Jyb3dzZXJzKCk7XG5cbiAgICBpZiAoT1MubGludXgpXG4gICAgICAgIHJldHVybiBhd2FpdCBmaW5kTGludXhCcm93c2VycygpO1xufVxuXG5cbi8vIE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AgICAgIC5tYXAoZmlsZU5hbWUgPT4ge1xuICAgICAgICAgICAgLy8gTk9URTogcmVzdG9yZSBzcGFjZVxuICAgICAgICAgICAgZmlsZU5hbWUgPSBmaWxlTmFtZS5yZXBsYWNlKC8wMzIvZywgJyAnKTtcblxuICAgICAgICAgICAgdmFyIG5hbWUgPSBmaWxlTmFtZS5yZXBsYWNlKC8uYXBwJC8sICcnKTtcbiAgICAgICAgICAgIHZhciBwYXRoID0gYC9BcHBsaWNhdGlvbnMvJHtmaWxlTmFtZX1gO1xuXG4gICAgICAgICAgICByZXR1cm4gYWRkSW5zdGFsbGF0aW9uKGluc3RhbGxhdGlvbnMsIG5hbWUsIHBhdGgpO1xuICAgICAgICB9KSk7XG5cbiAgICByZXR1cm4gaW5zdGFsbGF0aW9ucztcbn1cblxuYXN5bmMgZnVuY3Rpb24gZmluZExpbnV4QnJvd3NlcnMgKCkge1xuICAgIHZhciBpbnN0YWxsYXRpb25zID0ge307XG5cbiAgICB2YXIgYWxpYXNDaGVja2luZ1Byb21pc2VzID0gT2JqZWN0XG4gICAgICAgIC5rZXlzKEFMSUFTRVMpXG4gICAgICAgIC5tYXAobmFtZSA9PiB7XG4gICAgICAgICAgICB2YXIgeyBsaW51eEJpbmFyaWVzIH0gPSBBTElBU0VTW25hbWVdO1xuXG4gICAgICAgICAgICBpZiAoIWxpbnV4QmluYXJpZXMpXG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG5cbiAgICAgICAgICAgIHZhciBkZXRlY3Rpb25Qcm9taXNlcyA9IGxpbnV4QmluYXJpZXNcbiAgICAgICAgICAgICAgICAubWFwKGJpbmFyeSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB3aGljaChiaW5hcnkpXG4gICAgICAgICAgICAgICAgICAgICAgICAudGhlbihwYXRoID0+IGFkZEluc3RhbGxhdGlvbihpbnN0YWxsYXRpb25zLCBuYW1lLCBwYXRoKSlcbiAgICAgICAgICAgICAgICAgICAgICAgIC5j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ICgpIHtcbiAgICBpZiAoIWluc3RhbGxhdGlvbnNDYWNoZSlcbiAgICAgICAgaW5zdGFsbGF0aW9uc0NhY2hlID0gYXdhaXQgZmluZEJyb3dzZXJzKCk7XG5cbiAgICByZXR1cm4gaW5zdGFsbGF0aW9uc0NhY2hlO1xufVxuIl19

25

lib/utils/exec.js

@@ -11,2 +11,3 @@ "use strict";

const del_1 = __importDefault(require("del"));
const execa_1 = __importDefault(require("execa"));
const os_family_1 = __importDefault(require("os-family"));

@@ -16,2 +17,3 @@ const nanoid_1 = __importDefault(require("nanoid"));

const binaries_1 = __importDefault(require("../binaries"));
const flatten_whitespace_1 = __importDefault(require("./flatten-whitespace"));
const errors_1 = require("../errors");

@@ -21,2 +23,16 @@ const EXIT_CODE_REGEXP = /Exit code: (-?\d+)/;

const TEMP_PIPE_NAME = seed => `testcafe-browser-tools-fifo-${seed}`;
const POWERSHELL_BINARY = 'powershell.exe';
const POWERSHELL_ARGS = ['-NoLogo', '-NonInteractive', '-Command'];
const POWERSHELL_COMMAND_WRAPPER = command => flatten_whitespace_1.default `
$cp = (chcp | Select-String '\\d+').Matches.Value;
Try
{
chcp 65001;
${command};
}
Finally
{
chcp $cp;
}
`;
function getTempPipePath() {

@@ -92,2 +108,9 @@ return path_1.default.join(os_1.default.tmpdir(), TEMP_PIPE_NAME(nanoid_1.default()));

exports.exec = exec;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXhlYy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlscy9leGVjLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsa0VBQXNDO0FBQ3RDLDRDQUFvQjtBQUNwQiw0Q0FBb0I7QUFDcEIsZ0RBQXdCO0FBQ3hCLDhDQUFzQjtBQUN0QiwwREFBMkI7QUFDM0Isb0RBQTRCO0FBQzVCLDREQUFvQztBQUNwQywyREFBbU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iAgICBjYXRjaCAoZXJyKSB7XG4gICAgICAgIGlmIChlcnIgaW5zdGFuY2VvZiBOYXRpdmVCaW5hcnlIYXNGYWlsZWRFcnJvcilcbiAgICAgICAgICAgIHRocm93IGVycjtcblxuICAgICAgICBjb25zdCBlcnJvckNvZGUgPSBlcnIuc3RhdHVzIHx8IGVyci5jb2RlO1xuXG4gICAgICAgIGlmIChlcnJvckNvZGUgPT09IHZvaWQgMCB8fCB0eXBlb2YgZXJyb3JDb2RlID09PSAnc3RyaW5nJylcbiAgICAgICAgICAgIHRocm93IGVycjtcblxuICAgICAgICB0aHJvdyBuZXcgTmF0aXZlQmluYXJ5SGFzRmFpbGVkRXJyb3IoeyBiaW5hcnk6IGZpbGVQYXRoLCBleGl0Q29kZTogZXJyb3JDb2RlIH0pO1xuICAgIH1cbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIGV4ZWMgKGNvbW1hbmQpIHtcbiAgICByZXR1cm4gZXhlY1Byb21pc2UoY29tbWFuZCwgeyBlbnY6IHByb2Nlc3MuZW52IH0pO1xufVxuIl19
async function execPowershell(command) {
const wrappedCommand = POWERSHELL_COMMAND_WRAPPER(command);
// NOTE: We have to ignore stdin due to a problem with PowerShell 2.0
// See https://stackoverflow.com/a/9157170/11818061 for details.
return execa_1.default(POWERSHELL_BINARY, [...POWERSHELL_ARGS, `"${wrappedCommand}"`], { stdin: 'ignore', shell: true });
}
exports.execPowershell = execPowershell;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXhlYy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlscy9leGVjLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsa0VBQXNDO0FBQ3RDLDRDQUFvQjtBQUNwQiw0Q0FBb0I7QUFDcEIsZ0RBQXdCO0FBQ3hCLDhDQUFzQjtBQUN0QixrREFBMEI7QUFDMU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vbS9hLzkxNTcxNzAvMTE4MTgwNjEgZm9yIGRldGFpbHMuXG4gICAgcmV0dXJuIGV4ZWNhKFBPV0VSU0hFTExfQklOQVJZLCBbLi4uUE9XRVJTSEVMTF9BUkdTLCBgXCIke3dyYXBwZWRDb21tYW5kfVwiYF0sIHsgc3RkaW46ICdpZ25vcmUnLCBzaGVsbDogdHJ1ZSB9KTtcbn1cbiJdfQ==
{
"name": "testcafe-browser-tools",
"version": "2.0.1",
"version": "2.0.2",
"description": "An utility library for performing platform-dependent actions on browsers.",

@@ -22,2 +22,3 @@ "homepage": "https://github.com/DevExpress/testcafe-browser-tools",

"graceful-fs": "^4.1.11",
"execa": "^3.3.0",
"linux-platform-info": "^0.0.3",

@@ -40,3 +41,2 @@ "mkdirp": "^0.5.1",

"eslint-plugin-babel": "^2.1.1",
"execa": "^0.9.0",
"express": "^3.21.1",

@@ -43,0 +43,0 @@ "gulp": "^4.0.2",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc