HiddenBrowser: options is optional, support data: URIs
This commit is contained in:
parent
82107beaa9
commit
e7b792e2d5
1 changed files with 2 additions and 2 deletions
|
@ -121,14 +121,14 @@ class HiddenBrowser {
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {String} source - HTTP URL, file: URL, or file path
|
* @param {String} source - HTTP URL, file: URL, or file path
|
||||||
* @param {Object} options
|
* @param {Object} [options]
|
||||||
* @param {Boolean} [options.requireSuccessfulStatus]
|
* @param {Boolean} [options.requireSuccessfulStatus]
|
||||||
* @returns {Promise<boolean>}
|
* @returns {Promise<boolean>}
|
||||||
*/
|
*/
|
||||||
async load(source, options) {
|
async load(source, options) {
|
||||||
await this._createdPromise;
|
await this._createdPromise;
|
||||||
let url;
|
let url;
|
||||||
if (/^(file|https?|chrome|resource|blob):/.test(source)) {
|
if (/^(file|https?|chrome|resource|blob|data):/.test(source)) {
|
||||||
url = source;
|
url = source;
|
||||||
}
|
}
|
||||||
// Convert string path to file: URL
|
// Convert string path to file: URL
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue