Browse Source

Enable moz-extension:// too

This is a follow up for https://github.com/naptha/tesseract.js/pull/373
pull/374/head
Andrea Giammarchi 5 years ago committed by GitHub
parent
commit
5a7576ceb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/worker/node/loadImage.js

2
src/worker/node/loadImage.js

@ -19,7 +19,7 @@ module.exports = async (image) => { @@ -19,7 +19,7 @@ module.exports = async (image) => {
}
if (typeof image === 'string') {
if (isURL(image) || image.startsWith('chrome-extension://') || image.startsWith('file://')) {
if (isURL(image) || image.startsWith('moz-extension://') || image.startsWith('chrome-extension://') || image.startsWith('file://')) {
const { data: _data } = await axios.get(image, { responseType: 'arraybuffer' });
data = _data;
} else if (/data:image\/([a-zA-Z]*);base64,([^"]*)/.test(image)) {

Loading…
Cancel
Save