Skip to content

Commit

Permalink
Support usage in Electron-based application
Browse files Browse the repository at this point in the history
especially targeting VS Code

fixes #98
relates to asciidoctor/asciidoctor-vscode#731

Signed-off-by: Aurélien Pupier <apupier@redhat.com>
  • Loading branch information
apupier committed Aug 17, 2023
1 parent 4fbc399 commit 6f70e9c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/XMLHttpRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,8 @@ exports.XMLHttpRequest = function () {
const output = require('child_process').execSync(`"${process.execPath}" "${scriptPath}" \
--ssl="${ssl}" \
--encoding="${encoding}" \
--request-options=${JSON.stringify(JSON.stringify(options))}`, { stdio: ['pipe', 'pipe', 'pipe'], input: data, maxBuffer: maxBuffer })
--request-options=${JSON.stringify(JSON.stringify(options))} \
--ms-enable-electron-run-as-node`, { stdio: ['pipe', 'pipe', 'pipe'], input: data, maxBuffer: maxBuffer, env: { ...process.env, ELECTRON_RUN_AS_NODE: true } })
const result = JSON.parse(output.toString('utf8'))
if (result.error) {
throw translateError(result.error, url)
Expand Down

0 comments on commit 6f70e9c

Please sign in to comment.