forked from enviPath/enviPy
Current Dev State
This commit is contained in:
10
static/js/ketcher2/node_modules/chromedriver/Dockerfile
generated
vendored
Normal file
10
static/js/ketcher2/node_modules/chromedriver/Dockerfile
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
FROM ubuntu:16.04
|
||||
MAINTAINER Giovanni Bassi <giggio@giggio.net>
|
||||
|
||||
RUN mkdir /app
|
||||
WORKDIR /app
|
||||
RUN apt-get update && \
|
||||
apt-get install -y git curl build-essential vim libfontconfig1 libgconf-2-4 libnss3
|
||||
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.4/install.sh | bash
|
||||
RUN [ "/bin/bash", "-c", "source $HOME/.nvm/nvm.sh && nvm i 0.12 && nvm i 4 && nvm i 6 && nvm i 7 && nvm alias default 7" ]
|
||||
RUN git clone https://github.com/giggio/node-chromedriver.git . && git remote add ssh git@github.com:giggio/node-chromedriver.git
|
||||
201
static/js/ketcher2/node_modules/chromedriver/LICENSE.txt
generated
vendored
Normal file
201
static/js/ketcher2/node_modules/chromedriver/LICENSE.txt
generated
vendored
Normal file
@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "{}"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright 2014 Giovanni Bassi and Elemar Jr.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
187
static/js/ketcher2/node_modules/chromedriver/README.md
generated
vendored
Normal file
187
static/js/ketcher2/node_modules/chromedriver/README.md
generated
vendored
Normal file
@ -0,0 +1,187 @@
|
||||
ChromeDriver
|
||||
=======
|
||||
[](https://travis-ci.org/giggio/node-chromedriver/) [](https://ci.appveyor.com/project/giggio/node-chromedriver)
|
||||
[](https://www.npmjs.com/package/chromedriver)
|
||||
|
||||
An NPM wrapper for Selenium [ChromeDriver](https://sites.google.com/a/chromium.org/chromedriver/).
|
||||
|
||||
Building and Installing
|
||||
-----------------------
|
||||
|
||||
```shell
|
||||
npm install chromedriver
|
||||
```
|
||||
|
||||
Or grab the source and
|
||||
|
||||
```shell
|
||||
node ./install.js
|
||||
```
|
||||
|
||||
What this is really doing is just grabbing a particular "blessed" (by
|
||||
this module) version of ChromeDriver. As new versions are released
|
||||
and vetted, this module will be updated accordingly.
|
||||
|
||||
The package has been set up to fetch and run ChromeDriver for MacOS (darwin),
|
||||
Linux based platforms (as identified by nodejs), and Windows. If you
|
||||
spot any platform weirdnesses, let us know or send a patch.
|
||||
|
||||
### Custom binaries url
|
||||
|
||||
To use a mirror of the ChromeDriver binaries use npm config property `chromedriver_cdnurl`.
|
||||
Default is `http://chromedriver.storage.googleapis.com`.
|
||||
|
||||
```shell
|
||||
npm install chromedriver --chromedriver_cdnurl=https://npm.taobao.org/mirrors/chromedriver
|
||||
```
|
||||
|
||||
Or add property into your [`.npmrc`](https://docs.npmjs.com/files/npmrc) file.
|
||||
|
||||
```
|
||||
chromedriver_cdnurl=https://npm.taobao.org/mirrors/chromedriver
|
||||
```
|
||||
|
||||
Another option is to use PATH variable `CHROMEDRIVER_CDNURL`.
|
||||
|
||||
```shell
|
||||
CHROMEDRIVER_CDNURL=https://npm.taobao.org/mirrors/chromedriver npm install chromedriver
|
||||
```
|
||||
|
||||
### Custom binaries file
|
||||
|
||||
To get the chromedriver from the filesystem instead of a web request use the npm config property `chromedriver_filepath`.
|
||||
|
||||
```shell
|
||||
npm install chromedriver --chromedriver_filepath=/path/to/chromedriver_mac64.zip
|
||||
```
|
||||
|
||||
Or add property into your [`.npmrc`](https://docs.npmjs.com/files/npmrc) file.
|
||||
|
||||
```
|
||||
chromedriver_filepath=/path/to/chromedriver_mac64.zip
|
||||
```
|
||||
|
||||
Another option is to use the PATH variable `CHROMEDRIVER_FILEPATH`
|
||||
|
||||
```shell
|
||||
CHROMEDRIVER_FILEPATH=/path/to/chromedriver_mac64.zip
|
||||
```
|
||||
|
||||
Running
|
||||
-------
|
||||
|
||||
```shell
|
||||
bin/chromedriver [arguments]
|
||||
```
|
||||
|
||||
And npm will install a link to the binary in `node_modules/.bin` as
|
||||
it is wont to do.
|
||||
|
||||
Running with Selenium WebDriver
|
||||
-------------------------------
|
||||
|
||||
```javascript
|
||||
require('chromedriver');
|
||||
var webdriver = require('selenium-webdriver');
|
||||
var driver = new webdriver.Builder()
|
||||
.forBrowser('chrome')
|
||||
.build();
|
||||
```
|
||||
|
||||
(Tested for selenium-webdriver version `2.48.2`)
|
||||
|
||||
The path will be added to the process automatically, you don't need to configure it.
|
||||
But you can get it from `require('chromedriver').path` if you want it.
|
||||
|
||||
Running via node
|
||||
----------------
|
||||
|
||||
The package exports a `path` string that contains the path to the
|
||||
chromdriver binary/executable.
|
||||
|
||||
Below is an example of using this package via node.
|
||||
|
||||
```javascript
|
||||
var childProcess = require('child_process');
|
||||
var chromedriver = require('chromedriver');
|
||||
var binPath = chromedriver.path;
|
||||
|
||||
var childArgs = [
|
||||
'some argument'
|
||||
];
|
||||
|
||||
childProcess.execFile(binPath, childArgs, function(err, stdout, stderr) {
|
||||
// handle results
|
||||
});
|
||||
|
||||
```
|
||||
|
||||
You can also use the start and stop methods:
|
||||
|
||||
```javascript
|
||||
var chromedriver = require('chromedriver');
|
||||
|
||||
args = [
|
||||
// optional arguments
|
||||
];
|
||||
chromedriver.start(args);
|
||||
// run your tests
|
||||
chromedriver.stop();
|
||||
|
||||
```
|
||||
Note: if your tests are ran asynchronously, chromedriver.stop() will have to be
|
||||
executed as a callback at the end of your tests
|
||||
|
||||
Versioning
|
||||
----------
|
||||
|
||||
The NPM package version tracks the version of chromedriver that will be installed,
|
||||
with an additional build number that is used for revisions to the installer.
|
||||
You can use the package version number to install a specific version, or use the
|
||||
setting to a specific version. To always install the latest version of Chromedriver,
|
||||
use `LATEST` as the version number:
|
||||
|
||||
```shell
|
||||
npm install chromedriver --chromedriver_version=LATEST
|
||||
```
|
||||
|
||||
Or add property into your [`.npmrc`](https://docs.npmjs.com/files/npmrc) file.
|
||||
|
||||
```
|
||||
chromedriver_version=LATEST
|
||||
```
|
||||
|
||||
Another option is to use env variable `CHROMEDRIVER_VERSION`.
|
||||
|
||||
```shell
|
||||
CHROMEDRIVER_VERSION=LATEST npm install chromedriver
|
||||
```
|
||||
|
||||
A Note on chromedriver
|
||||
-------------------
|
||||
|
||||
Chromedriver is not a library for NodeJS.
|
||||
|
||||
This is an _NPM wrapper_ and can be used to conveniently make ChromeDriver available
|
||||
It is not a Node JS wrapper.
|
||||
|
||||
Contributing
|
||||
------------
|
||||
|
||||
Questions, comments, bug reports, and pull requests are all welcome. Submit them at
|
||||
[the project on GitHub](https://github.com/giggio/node-chromedriver/).
|
||||
|
||||
Bug reports that include steps-to-reproduce (including code) are the
|
||||
best. Even better, make them in the form of pull requests.
|
||||
|
||||
Author
|
||||
------
|
||||
|
||||
[Giovanni Bassi](https://github.com/giggio)
|
||||
|
||||
Thanks for Obvious and their PhantomJS project for heavy inspiration! Check their project on [Github](https://github.com/Obvious/phantomjs/tree/master/bin).
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
Licensed under the Apache License, Version 2.0.
|
||||
20
static/js/ketcher2/node_modules/chromedriver/appveyor.yml
generated
vendored
Normal file
20
static/js/ketcher2/node_modules/chromedriver/appveyor.yml
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
version: 1.0.{build}
|
||||
environment:
|
||||
matrix:
|
||||
- nodejs_version: 4
|
||||
- nodejs_version: 5
|
||||
- nodejs_version: 6
|
||||
- nodejs_version: 7
|
||||
- nodejs_version: 8
|
||||
install:
|
||||
- cmd: npm install
|
||||
build: off
|
||||
test_script:
|
||||
- ps: >-
|
||||
$nodeProcess = start node bin\chromedriver -PassThru
|
||||
|
||||
sleep 5
|
||||
|
||||
if ($nodeProcess.HasExited) { exit 1 }
|
||||
|
||||
Stop-Process -Id $nodeProcess.Id -Force
|
||||
13
static/js/ketcher2/node_modules/chromedriver/bin/chromedriver
generated
vendored
Executable file
13
static/js/ketcher2/node_modules/chromedriver/bin/chromedriver
generated
vendored
Executable file
@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env node
|
||||
var path = require('path');
|
||||
var spawn = require('child_process').spawn;
|
||||
var binPath = require(path.join(__dirname, '..', 'lib', 'chromedriver')).path;
|
||||
var args = process.argv.slice(2);
|
||||
var cp = spawn(binPath, args);
|
||||
cp.stdout.pipe(process.stdout);
|
||||
cp.stderr.pipe(process.stderr);
|
||||
cp.on('exit', process.exit);
|
||||
process.on('SIGTERM', function() {
|
||||
cp.kill('SIGTERM');
|
||||
process.exit(1);
|
||||
});
|
||||
252
static/js/ketcher2/node_modules/chromedriver/install.js
generated
vendored
Normal file
252
static/js/ketcher2/node_modules/chromedriver/install.js
generated
vendored
Normal file
@ -0,0 +1,252 @@
|
||||
'use strict';
|
||||
|
||||
var extractZip = require('extract-zip');
|
||||
var fs = require('fs');
|
||||
var helper = require('./lib/chromedriver');
|
||||
var request = require('request');
|
||||
var kew = require('kew');
|
||||
var mkdirp = require('mkdirp');
|
||||
var path = require('path');
|
||||
var rimraf = require('rimraf').sync;
|
||||
var util = require('util');
|
||||
|
||||
var libPath = path.join(__dirname, 'lib', 'chromedriver');
|
||||
var cdnUrl = process.env.npm_config_chromedriver_cdnurl || process.env.CHROMEDRIVER_CDNURL || 'https://chromedriver.storage.googleapis.com';
|
||||
var configuredfilePath = process.env.npm_config_chromedriver_filepath || process.env.CHROMEDRIVER_FILEPATH;
|
||||
|
||||
// adapt http://chromedriver.storage.googleapis.com/
|
||||
cdnUrl = cdnUrl.replace(/\/+$/, '');
|
||||
var downloadUrl = cdnUrl + '/%s/chromedriver_%s.zip';
|
||||
var platform = process.platform;
|
||||
|
||||
var chromedriver_version = process.env.npm_config_chromedriver_version || process.env.CHROMEDRIVER_VERSION || helper.version;
|
||||
if (platform === 'linux') {
|
||||
if (process.arch === 'x64') {
|
||||
platform += '64';
|
||||
} else {
|
||||
platform += '32';
|
||||
}
|
||||
} else if (platform === 'darwin') {
|
||||
if (process.arch === 'x64') {
|
||||
platform = 'mac64';
|
||||
} else {
|
||||
console.log('Only Mac 64 bits supported.');
|
||||
process.exit(1);
|
||||
}
|
||||
} else if (platform === 'freebsd') {
|
||||
if (process.arch === 'x64') {
|
||||
platform = 'mac64';
|
||||
} else {
|
||||
platform = 'mac32';
|
||||
}
|
||||
} else if (platform !== 'win32') {
|
||||
console.log('Unexpected platform or architecture:', process.platform, process.arch);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
var tmpPath = findSuitableTempDirectory();
|
||||
var downloadedFile = '';
|
||||
var promise = kew.resolve(true);
|
||||
|
||||
promise = promise.then(function () {
|
||||
if (chromedriver_version === 'LATEST')
|
||||
return getLatestVersion(getRequestOptions(cdnUrl + '/LATEST_RELEASE'));
|
||||
});
|
||||
|
||||
// Start the install.
|
||||
promise = promise.then(function () {
|
||||
if (configuredfilePath) {
|
||||
console.log('Using file: ', configuredfilePath);
|
||||
downloadedFile = configuredfilePath;
|
||||
} else {
|
||||
downloadUrl = util.format(downloadUrl, chromedriver_version, platform);
|
||||
var fileName = downloadUrl.split('/').pop();
|
||||
downloadedFile = path.join(tmpPath, fileName);
|
||||
console.log('Downloading', downloadUrl);
|
||||
console.log('Saving to', downloadedFile);
|
||||
return requestBinary(getRequestOptions(downloadUrl), downloadedFile);
|
||||
}
|
||||
});
|
||||
|
||||
promise.then(function () {
|
||||
return extractDownload(downloadedFile, tmpPath);
|
||||
})
|
||||
.then(function () {
|
||||
return copyIntoPlace(tmpPath, libPath);
|
||||
})
|
||||
.then(function () {
|
||||
return fixFilePermissions();
|
||||
})
|
||||
.then(function () {
|
||||
console.log('Done. ChromeDriver binary available at', helper.path);
|
||||
})
|
||||
.fail(function (err) {
|
||||
console.error('ChromeDriver installation failed', err);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
|
||||
function findSuitableTempDirectory() {
|
||||
var now = Date.now();
|
||||
var candidateTmpDirs = [
|
||||
process.env.TMPDIR || process.env.TMP || process.env.npm_config_tmp,
|
||||
'/tmp',
|
||||
path.join(process.cwd(), 'tmp')
|
||||
];
|
||||
|
||||
for (var i = 0; i < candidateTmpDirs.length; i++) {
|
||||
if (!candidateTmpDirs[i]) continue;
|
||||
var candidatePath = path.join(candidateTmpDirs[i], 'chromedriver');
|
||||
try {
|
||||
mkdirp.sync(candidatePath, '0777');
|
||||
var testFile = path.join(candidatePath, now + '.tmp');
|
||||
fs.writeFileSync(testFile, 'test');
|
||||
fs.unlinkSync(testFile);
|
||||
return candidatePath;
|
||||
} catch (e) {
|
||||
console.log(candidatePath, 'is not writable:', e.message);
|
||||
}
|
||||
}
|
||||
|
||||
console.error('Can not find a writable tmp directory, please report issue on https://github.com/giggio/chromedriver/issues/ with as much information as possible.');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
|
||||
function getRequestOptions(downloadPath) {
|
||||
var options = {uri: downloadPath};
|
||||
var proxyUrl = options.protocol === 'https:'
|
||||
? process.env.npm_config_https_proxy
|
||||
: (process.env.npm_config_proxy || process.env.npm_config_http_proxy);
|
||||
if (proxyUrl) {
|
||||
options.proxy = proxyUrl;
|
||||
}
|
||||
|
||||
options.strictSSL = !!process.env.npm_config_strict_ssl;
|
||||
|
||||
// Use certificate authority settings from npm
|
||||
var ca = process.env.npm_config_ca;
|
||||
if (!ca && process.env.npm_config_cafile) {
|
||||
try {
|
||||
ca = fs.readFileSync(process.env.npm_config_cafile, {encoding: 'utf8'})
|
||||
.split(/\n(?=-----BEGIN CERTIFICATE-----)/g);
|
||||
|
||||
// Comments at the beginning of the file result in the first
|
||||
// item not containing a certificate - in this case the
|
||||
// download will fail
|
||||
if (ca.length > 0 && !/-----BEGIN CERTIFICATE-----/.test(ca[0])) {
|
||||
ca.shift();
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
console.error('Could not read cafile', process.env.npm_config_cafile, e);
|
||||
}
|
||||
}
|
||||
|
||||
if (ca) {
|
||||
console.log('Using npmconf ca');
|
||||
options.agentOptions = {
|
||||
ca: ca
|
||||
};
|
||||
options.ca = ca;
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
function getLatestVersion(requestOptions) {
|
||||
var deferred = kew.defer();
|
||||
request.get(requestOptions, function (err, response, data) {
|
||||
if (err) {
|
||||
deferred.reject('Error with ' + requestOptions.protocol + ' request: ' + err);
|
||||
} else {
|
||||
chromedriver_version = data.trim();
|
||||
deferred.resolve(true);
|
||||
}
|
||||
});
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
function requestBinary(requestOptions, filePath) {
|
||||
var deferred = kew.defer();
|
||||
|
||||
var count = 0;
|
||||
var notifiedCount = 0;
|
||||
var outFile = fs.openSync(filePath, 'w');
|
||||
|
||||
var client = request.get(requestOptions);
|
||||
|
||||
client.on('error', function (err) {
|
||||
deferred.reject('Error with http request: ' + err);
|
||||
});
|
||||
|
||||
client.on('data', function (data) {
|
||||
fs.writeSync(outFile, data, 0, data.length, null);
|
||||
count += data.length;
|
||||
if ((count - notifiedCount) > 800000) {
|
||||
console.log('Received ' + Math.floor(count / 1024) + 'K...');
|
||||
notifiedCount = count;
|
||||
}
|
||||
});
|
||||
|
||||
client.on('end', function () {
|
||||
console.log('Received ' + Math.floor(count / 1024) + 'K total.');
|
||||
fs.closeSync(outFile);
|
||||
deferred.resolve(true);
|
||||
});
|
||||
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
function extractDownload(filePath, tmpPath) {
|
||||
var deferred = kew.defer();
|
||||
console.log('Extracting zip contents');
|
||||
extractZip(path.resolve(filePath), { dir: tmpPath }, function (err) {
|
||||
if (err) {
|
||||
deferred.reject('Error extracting archive: ' + err);
|
||||
} else {
|
||||
deferred.resolve(true);
|
||||
}
|
||||
});
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
|
||||
function copyIntoPlace(tmpPath, targetPath) {
|
||||
rimraf(targetPath);
|
||||
console.log("Copying to target path", targetPath);
|
||||
fs.mkdirSync(targetPath);
|
||||
|
||||
// Look for the extracted directory, so we can rename it.
|
||||
var files = fs.readdirSync(tmpPath);
|
||||
var promises = files.map(function (name) {
|
||||
var deferred = kew.defer();
|
||||
|
||||
var file = path.join(tmpPath, name);
|
||||
var reader = fs.createReadStream(file);
|
||||
|
||||
var targetFile = path.join(targetPath, name);
|
||||
var writer = fs.createWriteStream(targetFile);
|
||||
writer.on("close", function () {
|
||||
deferred.resolve(true);
|
||||
});
|
||||
|
||||
reader.pipe(writer);
|
||||
return deferred.promise;
|
||||
});
|
||||
|
||||
return kew.all(promises);
|
||||
}
|
||||
|
||||
|
||||
function fixFilePermissions() {
|
||||
// Check that the binary is user-executable and fix it if it isn't (problems with unzip library)
|
||||
if (process.platform != 'win32') {
|
||||
var stat = fs.statSync(helper.path);
|
||||
// 64 == 0100 (no octal literal in strict mode)
|
||||
if (!(stat.mode & 64)) {
|
||||
console.log('Fixing file permissions');
|
||||
fs.chmodSync(helper.path, '755');
|
||||
}
|
||||
}
|
||||
}
|
||||
13
static/js/ketcher2/node_modules/chromedriver/lib/chromedriver.js
generated
vendored
Normal file
13
static/js/ketcher2/node_modules/chromedriver/lib/chromedriver.js
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
var path = require('path');
|
||||
process.env.PATH += path.delimiter + path.join(__dirname, 'chromedriver');
|
||||
exports.path = process.platform === 'win32' ? path.join(__dirname, 'chromedriver', 'chromedriver.exe') : path.join(__dirname, 'chromedriver', 'chromedriver');
|
||||
exports.version = '2.30';
|
||||
exports.start = function(args) {
|
||||
exports.defaultInstance = require('child_process').execFile(exports.path, args);
|
||||
return exports.defaultInstance;
|
||||
};
|
||||
exports.stop = function () {
|
||||
if (exports.defaultInstance != null){
|
||||
exports.defaultInstance.kill();
|
||||
}
|
||||
};
|
||||
BIN
static/js/ketcher2/node_modules/chromedriver/lib/chromedriver/chromedriver
generated
vendored
Executable file
BIN
static/js/ketcher2/node_modules/chromedriver/lib/chromedriver/chromedriver
generated
vendored
Executable file
Binary file not shown.
BIN
static/js/ketcher2/node_modules/chromedriver/lib/chromedriver/chromedriver_linux64.zip
generated
vendored
Normal file
BIN
static/js/ketcher2/node_modules/chromedriver/lib/chromedriver/chromedriver_linux64.zip
generated
vendored
Normal file
Binary file not shown.
436
static/js/ketcher2/node_modules/chromedriver/package-lock.json
generated
vendored
Normal file
436
static/js/ketcher2/node_modules/chromedriver/package-lock.json
generated
vendored
Normal file
@ -0,0 +1,436 @@
|
||||
{
|
||||
"name": "chromedriver",
|
||||
"version": "2.29.1",
|
||||
"lockfileVersion": 1,
|
||||
"dependencies": {
|
||||
"ajv": {
|
||||
"version": "4.11.8",
|
||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz",
|
||||
"integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY="
|
||||
},
|
||||
"asn1": {
|
||||
"version": "0.2.3",
|
||||
"resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz",
|
||||
"integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y="
|
||||
},
|
||||
"assert-plus": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz",
|
||||
"integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ="
|
||||
},
|
||||
"asynckit": {
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
|
||||
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
|
||||
},
|
||||
"aws-sign2": {
|
||||
"version": "0.6.0",
|
||||
"resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz",
|
||||
"integrity": "sha1-FDQt0428yU0OW4fXY81jYSwOeU8="
|
||||
},
|
||||
"aws4": {
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz",
|
||||
"integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4="
|
||||
},
|
||||
"balanced-match": {
|
||||
"version": "0.4.2",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz",
|
||||
"integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg="
|
||||
},
|
||||
"bcrypt-pbkdf": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz",
|
||||
"integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=",
|
||||
"optional": true
|
||||
},
|
||||
"boom": {
|
||||
"version": "2.10.1",
|
||||
"resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz",
|
||||
"integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8="
|
||||
},
|
||||
"brace-expansion": {
|
||||
"version": "1.1.7",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.7.tgz",
|
||||
"integrity": "sha1-Pv/DxQ4ABTH7cg6v+A8K6O8jz1k="
|
||||
},
|
||||
"caseless": {
|
||||
"version": "0.12.0",
|
||||
"resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz",
|
||||
"integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw="
|
||||
},
|
||||
"co": {
|
||||
"version": "4.6.0",
|
||||
"resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz",
|
||||
"integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ="
|
||||
},
|
||||
"combined-stream": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz",
|
||||
"integrity": "sha1-k4NwpXtKUd6ix3wV1cX9+JUWQAk="
|
||||
},
|
||||
"concat-map": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
|
||||
},
|
||||
"concat-stream": {
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.0.tgz",
|
||||
"integrity": "sha1-CqxmL9Ur54lk1VMvaUeE5wEQrPc="
|
||||
},
|
||||
"core-util-is": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
|
||||
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
|
||||
},
|
||||
"cryptiles": {
|
||||
"version": "2.0.5",
|
||||
"resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz",
|
||||
"integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g="
|
||||
},
|
||||
"dashdash": {
|
||||
"version": "1.14.1",
|
||||
"resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz",
|
||||
"integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=",
|
||||
"dependencies": {
|
||||
"assert-plus": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
|
||||
"integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU="
|
||||
}
|
||||
}
|
||||
},
|
||||
"debug": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz",
|
||||
"integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo="
|
||||
},
|
||||
"delayed-stream": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
||||
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
|
||||
},
|
||||
"ecc-jsbn": {
|
||||
"version": "0.1.1",
|
||||
"resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz",
|
||||
"integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=",
|
||||
"optional": true
|
||||
},
|
||||
"extend": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz",
|
||||
"integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ="
|
||||
},
|
||||
"extract-zip": {
|
||||
"version": "1.6.5",
|
||||
"resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.6.5.tgz",
|
||||
"integrity": "sha1-maBnNbbqIOqbcF13ms/8yHz/BEA=",
|
||||
"dependencies": {
|
||||
"mkdirp": {
|
||||
"version": "0.5.0",
|
||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.0.tgz",
|
||||
"integrity": "sha1-HXMHam35hs2TROFecfzAWkyavxI="
|
||||
}
|
||||
}
|
||||
},
|
||||
"extsprintf": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz",
|
||||
"integrity": "sha1-4QgOBljjALBilJkMxw4VAiNf1VA="
|
||||
},
|
||||
"fd-slicer": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.0.1.tgz",
|
||||
"integrity": "sha1-i1vL2ewyfFBBv5qwI/1nUPEXfmU="
|
||||
},
|
||||
"forever-agent": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz",
|
||||
"integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE="
|
||||
},
|
||||
"form-data": {
|
||||
"version": "2.1.4",
|
||||
"resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz",
|
||||
"integrity": "sha1-M8GDrPGTJ27KqYFDpp6Uv+4XUNE="
|
||||
},
|
||||
"fs.realpath": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
|
||||
},
|
||||
"getpass": {
|
||||
"version": "0.1.7",
|
||||
"resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz",
|
||||
"integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=",
|
||||
"dependencies": {
|
||||
"assert-plus": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
|
||||
"integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU="
|
||||
}
|
||||
}
|
||||
},
|
||||
"glob": {
|
||||
"version": "7.1.2",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
|
||||
"integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ=="
|
||||
},
|
||||
"har-schema": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/har-schema/-/har-schema-1.0.5.tgz",
|
||||
"integrity": "sha1-0mMTX0MwfALGAq/I/pWXDAFRNp4="
|
||||
},
|
||||
"har-validator": {
|
||||
"version": "4.2.1",
|
||||
"resolved": "https://registry.npmjs.org/har-validator/-/har-validator-4.2.1.tgz",
|
||||
"integrity": "sha1-M0gdDxu/9gDdID11gSpqX7oALio="
|
||||
},
|
||||
"hawk": {
|
||||
"version": "3.1.3",
|
||||
"resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz",
|
||||
"integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ="
|
||||
},
|
||||
"hoek": {
|
||||
"version": "2.16.3",
|
||||
"resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz",
|
||||
"integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0="
|
||||
},
|
||||
"http-signature": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz",
|
||||
"integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8="
|
||||
},
|
||||
"inflight": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
||||
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk="
|
||||
},
|
||||
"inherits": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
|
||||
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
|
||||
},
|
||||
"is-typedarray": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
|
||||
"integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo="
|
||||
},
|
||||
"isarray": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
|
||||
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
|
||||
},
|
||||
"isstream": {
|
||||
"version": "0.1.2",
|
||||
"resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
|
||||
"integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo="
|
||||
},
|
||||
"jsbn": {
|
||||
"version": "0.1.1",
|
||||
"resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz",
|
||||
"integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=",
|
||||
"optional": true
|
||||
},
|
||||
"json-schema": {
|
||||
"version": "0.2.3",
|
||||
"resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz",
|
||||
"integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM="
|
||||
},
|
||||
"json-stable-stringify": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz",
|
||||
"integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8="
|
||||
},
|
||||
"json-stringify-safe": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
|
||||
"integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus="
|
||||
},
|
||||
"jsonify": {
|
||||
"version": "0.0.0",
|
||||
"resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz",
|
||||
"integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM="
|
||||
},
|
||||
"jsprim": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.0.tgz",
|
||||
"integrity": "sha1-o7h+QCmNjDgFUtjMdiigu5WiKRg=",
|
||||
"dependencies": {
|
||||
"assert-plus": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
|
||||
"integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU="
|
||||
}
|
||||
}
|
||||
},
|
||||
"kew": {
|
||||
"version": "0.7.0",
|
||||
"resolved": "https://registry.npmjs.org/kew/-/kew-0.7.0.tgz",
|
||||
"integrity": "sha1-edk9LTM2PW/dKXCzNdkUGtWR15s="
|
||||
},
|
||||
"mime-db": {
|
||||
"version": "1.27.0",
|
||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.27.0.tgz",
|
||||
"integrity": "sha1-gg9XIpa70g7CXtVeW13oaeVDbrE="
|
||||
},
|
||||
"mime-types": {
|
||||
"version": "2.1.15",
|
||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.15.tgz",
|
||||
"integrity": "sha1-pOv1BkCUVpI3uM9wBGd20J/JKu0="
|
||||
},
|
||||
"minimatch": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
||||
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA=="
|
||||
},
|
||||
"minimist": {
|
||||
"version": "0.0.8",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
|
||||
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0="
|
||||
},
|
||||
"mkdirp": {
|
||||
"version": "0.5.1",
|
||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
|
||||
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM="
|
||||
},
|
||||
"ms": {
|
||||
"version": "0.7.1",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz",
|
||||
"integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg="
|
||||
},
|
||||
"oauth-sign": {
|
||||
"version": "0.8.2",
|
||||
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz",
|
||||
"integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM="
|
||||
},
|
||||
"once": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E="
|
||||
},
|
||||
"path-is-absolute": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
||||
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
|
||||
},
|
||||
"pend": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz",
|
||||
"integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA="
|
||||
},
|
||||
"performance-now": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/performance-now/-/performance-now-0.2.0.tgz",
|
||||
"integrity": "sha1-M+8wxcd9TqIcWlOGnZG1bY8lVeU="
|
||||
},
|
||||
"process-nextick-args": {
|
||||
"version": "1.0.7",
|
||||
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz",
|
||||
"integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M="
|
||||
},
|
||||
"punycode": {
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz",
|
||||
"integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4="
|
||||
},
|
||||
"qs": {
|
||||
"version": "6.4.0",
|
||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz",
|
||||
"integrity": "sha1-E+JtKK1rD/qpExLNO/cI7TUecjM="
|
||||
},
|
||||
"readable-stream": {
|
||||
"version": "2.2.11",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.11.tgz",
|
||||
"integrity": "sha512-h+8+r3MKEhkiVrwdKL8aWs1oc1VvBu33ueshOvS26RsZQ3Amhx/oO3TKe4lApSV9ueY6as8EAh7mtuFjdlhg9Q=="
|
||||
},
|
||||
"request": {
|
||||
"version": "2.81.0",
|
||||
"resolved": "https://registry.npmjs.org/request/-/request-2.81.0.tgz",
|
||||
"integrity": "sha1-xpKJRqDgbF+Nb4qTM0af/aRimKA="
|
||||
},
|
||||
"rimraf": {
|
||||
"version": "2.6.1",
|
||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.1.tgz",
|
||||
"integrity": "sha1-wjOOxkPfeht/5cVPqG9XQopV8z0="
|
||||
},
|
||||
"safe-buffer": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.0.1.tgz",
|
||||
"integrity": "sha1-0mPKVGls2KMGtcplUekt5XkY++c="
|
||||
},
|
||||
"sntp": {
|
||||
"version": "1.0.9",
|
||||
"resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz",
|
||||
"integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg="
|
||||
},
|
||||
"sshpk": {
|
||||
"version": "1.13.1",
|
||||
"resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.1.tgz",
|
||||
"integrity": "sha1-US322mKHFEMW3EwY/hzx2UBzm+M=",
|
||||
"dependencies": {
|
||||
"assert-plus": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
|
||||
"integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU="
|
||||
}
|
||||
}
|
||||
},
|
||||
"string_decoder": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.2.tgz",
|
||||
"integrity": "sha1-sp4fThEl+pehA4K4pTNze3SR4Xk="
|
||||
},
|
||||
"stringstream": {
|
||||
"version": "0.0.5",
|
||||
"resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz",
|
||||
"integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg="
|
||||
},
|
||||
"tough-cookie": {
|
||||
"version": "2.3.2",
|
||||
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.2.tgz",
|
||||
"integrity": "sha1-8IH3bkyFcg5sN6X6ztc3FQ2EByo="
|
||||
},
|
||||
"tunnel-agent": {
|
||||
"version": "0.6.0",
|
||||
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
|
||||
"integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0="
|
||||
},
|
||||
"tweetnacl": {
|
||||
"version": "0.14.5",
|
||||
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz",
|
||||
"integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=",
|
||||
"optional": true
|
||||
},
|
||||
"typedarray": {
|
||||
"version": "0.0.6",
|
||||
"resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
|
||||
"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c="
|
||||
},
|
||||
"util-deprecate": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
|
||||
},
|
||||
"uuid": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.0.1.tgz",
|
||||
"integrity": "sha1-ZUS7ot/ajBzxfmKaOjBeK7H+5sE="
|
||||
},
|
||||
"verror": {
|
||||
"version": "1.3.6",
|
||||
"resolved": "https://registry.npmjs.org/verror/-/verror-1.3.6.tgz",
|
||||
"integrity": "sha1-z/XfEpRtKX0rqu+qJoniW+AcAFw="
|
||||
},
|
||||
"wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
|
||||
},
|
||||
"yauzl": {
|
||||
"version": "2.4.1",
|
||||
"resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.4.1.tgz",
|
||||
"integrity": "sha1-lSj0QtqxsihOWLQ3m7GU4i4MQAU="
|
||||
}
|
||||
}
|
||||
}
|
||||
62
static/js/ketcher2/node_modules/chromedriver/package.json
generated
vendored
Normal file
62
static/js/ketcher2/node_modules/chromedriver/package.json
generated
vendored
Normal file
@ -0,0 +1,62 @@
|
||||
{
|
||||
"_from": "chromedriver@2.30.1",
|
||||
"_id": "chromedriver@2.30.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-GMtsYcqOuLMsJd1ioTCORZjQHCY=",
|
||||
"_location": "/chromedriver",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "chromedriver@2.30.1",
|
||||
"name": "chromedriver",
|
||||
"escapedName": "chromedriver",
|
||||
"rawSpec": "2.30.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "2.30.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#DEV:/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-2.30.1.tgz",
|
||||
"_shasum": "18cb6c61ca8eb8b32c25dd62a1308e4598d01c26",
|
||||
"_spec": "chromedriver@2.30.1",
|
||||
"_where": "/home/manfred/enviPath/ketcher2/ketcher",
|
||||
"author": {
|
||||
"name": "Giovanni Bassi",
|
||||
"email": "giggio@giggio.net",
|
||||
"url": "http://www.lambda3.com.br"
|
||||
},
|
||||
"bin": {
|
||||
"chromedriver": "./bin/chromedriver"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/giggio/node-chromedriver/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"extract-zip": "^1.6.5",
|
||||
"kew": "^0.7.0",
|
||||
"mkdirp": "^0.5.1",
|
||||
"request": "^2.81.0",
|
||||
"rimraf": "^2.5.4"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "ChromeDriver for Selenium",
|
||||
"homepage": "https://github.com/giggio/node-chromedriver",
|
||||
"keywords": [
|
||||
"chromedriver",
|
||||
"selenium"
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"main": "lib/chromedriver",
|
||||
"name": "chromedriver",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/giggio/node-chromedriver.git"
|
||||
},
|
||||
"scripts": {
|
||||
"install": "node install.js"
|
||||
},
|
||||
"version": "2.30.1"
|
||||
}
|
||||
25
static/js/ketcher2/node_modules/chromedriver/test-driver.sh
generated
vendored
Executable file
25
static/js/ketcher2/node_modules/chromedriver/test-driver.sh
generated
vendored
Executable file
@ -0,0 +1,25 @@
|
||||
# Start ChromeDriver and make it non-blocking with ampersand
|
||||
./bin/chromedriver &
|
||||
|
||||
# Keep track of the ChromeDrivers Process ID
|
||||
TASK_PID=$!
|
||||
|
||||
# Wait for 10 seconds to give the ChromeDriver a chance to fail if there is an
|
||||
# issue.
|
||||
sleep 10
|
||||
|
||||
# ps -p Checks if the process is still running. If it is it returns 0,
|
||||
# otherwise it returns 1
|
||||
ps -p $TASK_PID > /dev/null
|
||||
TASK_RUNNING=$?
|
||||
|
||||
# Check if the process is still running by examining the exit code of ps -p
|
||||
TEST_RESULT=1
|
||||
if [ $TASK_RUNNING -eq 0 ]; then
|
||||
# Still running so return with safe exit code
|
||||
TEST_RESULT=0
|
||||
fi
|
||||
|
||||
kill $TASK_PID
|
||||
|
||||
exit $TEST_RESULT
|
||||
123
static/js/ketcher2/node_modules/chromedriver/testInstall.js
generated
vendored
Normal file
123
static/js/ketcher2/node_modules/chromedriver/testInstall.js
generated
vendored
Normal file
@ -0,0 +1,123 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
"use strict";
|
||||
|
||||
const os = require('os');
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const spawnSync = require('child_process').spawnSync;
|
||||
|
||||
const versions = ['0.12', '4', '6'];
|
||||
const tmpdir = os.tmpdir();
|
||||
|
||||
function directoryExists(file) {
|
||||
try {
|
||||
var stat = fs.lstatSync(file);
|
||||
return stat.isDirectory();
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function fileExists(file) {
|
||||
try {
|
||||
var stat = fs.lstatSync(file);
|
||||
return stat.isFile();
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function removeFolder(dir) {
|
||||
if (!fs.existsSync(dir)) return;
|
||||
fs.readdirSync(dir).forEach((file) => {
|
||||
let curPath = dir + path.sep + file;
|
||||
if (fs.lstatSync(curPath).isDirectory())
|
||||
removeFolder(curPath);
|
||||
else
|
||||
fs.unlinkSync(curPath);
|
||||
});
|
||||
fs.rmdirSync(dir);
|
||||
}
|
||||
|
||||
let tempInstallPath = path.resolve(tmpdir, 'chromedriver-test');
|
||||
if (directoryExists(tempInstallPath)) {
|
||||
console.log(`Deleting directory '${tempInstallPath}'.`);
|
||||
removeFolder(tempInstallPath);
|
||||
}
|
||||
fs.mkdirSync(tempInstallPath);
|
||||
|
||||
function checkSpawn(spawnInfo) {
|
||||
if (spawnInfo.stdout) {
|
||||
if (typeof (spawnInfo.stdout) !== 'string')
|
||||
console.log(spawnInfo.stdout.toString('utf8'));
|
||||
else
|
||||
console.log(spawnInfo.stdout);
|
||||
}
|
||||
if (spawnInfo.stderr) {
|
||||
if (typeof (spawnInfo.error) !== 'string')
|
||||
console.error(spawnInfo.stderr.toString('utf8'));
|
||||
else
|
||||
console.error(spawnInfo.stderr);
|
||||
}
|
||||
if (spawnInfo.status !== 0 || spawnInfo.error) {
|
||||
console.error('Failed when spawning.');
|
||||
process.exit(1);
|
||||
}
|
||||
if (typeof (spawnInfo.stdout) !== 'string')
|
||||
return spawnInfo.stdout.toString('utf8');
|
||||
else
|
||||
return spawnInfo.stdout;
|
||||
}
|
||||
|
||||
function nvmUse(version) {
|
||||
if (os.platform() === 'win32')
|
||||
var versionsText = checkSpawn(spawnSync('nvm', ['list']));
|
||||
else
|
||||
var versionsText = checkSpawn(spawnSync('/bin/bash', ['-c', 'source $HOME/.nvm/nvm.sh && nvm list']));
|
||||
const versionsAvailable = versionsText.split('\n').map(v => v.match(/\d+\.\d+\.\d+/)).filter(v => v).map(v => v[0]);
|
||||
var largestMatch = versionsAvailable.filter(v => v.match(`^${version}\.`)).map(v => v.match(/\d+\.(\d+)\.\d+/)).reduce(((max, v) => max[1] > v[1] ? max : v), [null, 0]);
|
||||
if (largestMatch.length === 0) {
|
||||
console.error(`Version '${version}' not found.`);
|
||||
process.exit(3);
|
||||
}
|
||||
var largestMatchingVersion = largestMatch.input;
|
||||
console.log(`Found version '${largestMatchingVersion}'.`);
|
||||
if (os.platform() === 'win32')
|
||||
checkSpawn(spawnSync('nvm', ['use', largestMatchingVersion]));
|
||||
else
|
||||
checkSpawn(spawnSync('/bin/bash', ['-c', `source $HOME/.nvm/nvm.sh && nvm use ${largestMatchingVersion}`]));
|
||||
}
|
||||
|
||||
function sleep(milliseconds) {
|
||||
const inAFewMilliseconds = new Date(new Date().getTime() + 2000);
|
||||
while (inAFewMilliseconds > new Date()) { }
|
||||
}
|
||||
|
||||
for (let version of versions) {
|
||||
console.log(`Testing version ${version}...`);
|
||||
let tempInstallPathForVersion = path.resolve(tmpdir, 'chromedriver-test', version);
|
||||
fs.mkdirSync(tempInstallPathForVersion);
|
||||
nvmUse(version);
|
||||
if (os.platform() === 'win32') {
|
||||
sleep(2000); // wait 2 seconds until everything is in place
|
||||
checkSpawn(spawnSync('cmd.exe', ['/c', `npm i ${__dirname}`], { cwd: tempInstallPathForVersion }));
|
||||
|
||||
} else {
|
||||
checkSpawn(spawnSync('npm', ['i', `${__dirname}`], { cwd: tempInstallPathForVersion }));
|
||||
}
|
||||
let executable = path.resolve(tempInstallPathForVersion, 'node_modules', 'chromedriver', 'lib', 'chromedriver', `chromedriver${os.platform() === 'win32' ? '.exe' : ''}`);
|
||||
if (fileExists(executable)) {
|
||||
console.log(`Version ${version} installed fine.`);
|
||||
}
|
||||
else {
|
||||
console.error(`Version ${version} did not install correctly, file '${executable}' was not found.`);
|
||||
process.exit(2);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
removeFolder(tempInstallPath);
|
||||
} catch (err) {
|
||||
console.error(`Could not delete folder '${tempInstallPath}'.`);
|
||||
}
|
||||
Reference in New Issue
Block a user