electron-html-to
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -11,2 +11,6 @@ 'use strict'; | ||
var _url = require('url'); | ||
var _url2 = _interopRequireDefault(_url); | ||
var _debug = require('debug'); | ||
@@ -133,3 +137,10 @@ | ||
// prefix the request in order to recognize later in electron protocol handler | ||
localOpts.url = localOpts.url || 'file://' + localOpts.htmlFile + '?ELECTRON-HTML-TO-LOAD-PAGE'; | ||
localOpts.url = localOpts.url || _url2['default'].format({ | ||
protocol: 'file', | ||
pathname: localOpts.htmlFile, | ||
query: { | ||
'ELECTRON-HTML-TO-LOAD-PAGE': true | ||
} | ||
}); | ||
localOpts.chromeCommandLineSwitches = options.chromeCommandLineSwitches; | ||
@@ -136,0 +147,0 @@ localOpts.extraHeaders = localOpts.extraHeaders || {}; |
@@ -25,3 +25,3 @@ /* eslint no-var: [0] */ | ||
log('request to load the page:', url); | ||
resolveFileRequest(url, callback); | ||
resolveFileRequest(requestObj.url, callback); | ||
} else if (requestObj.url.lastIndexOf('file:///', 0) === 0 && !allowLocalFilesAccess) { | ||
@@ -40,3 +40,3 @@ // potentially dangerous request | ||
log('request to load a file:', url); | ||
resolveFileRequest(url, callback); | ||
resolveFileRequest(requestObj.url, callback); | ||
} | ||
@@ -56,5 +56,9 @@ }, function (interceptProtocolErr) { | ||
var url = requestedUrl, | ||
parsedUrl, | ||
mimeType, | ||
fileBuf; | ||
parsedUrl = urlModule.parse(url); | ||
url = parsedUrl.pathname; | ||
if (isURLEncoded(url)) { | ||
@@ -68,3 +72,2 @@ url = decodeURIComponent(url); | ||
url = urlModule.parse(url).pathname; | ||
mimeType = mime.lookup(path.extname(url)) || 'text/plain'; | ||
@@ -71,0 +74,0 @@ |
{ | ||
"name": "electron-html-to", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Convert html to html/image using electron", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1622238
46398