Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing img data #50

Closed
VladimirAlexiev opened this issue Jul 17, 2018 · 10 comments
Closed

missing img data #50

VladimirAlexiev opened this issue Jul 17, 2018 · 10 comments

Comments

@VladimirAlexiev
Copy link

Latest Chrome Version 67.0.3396.99 (64-bit), Windows 10, latest version of SingleFile.

I have a local file with an img tag like this:

<img src="../images/Cyber Threat Controls Ontology.png" alt="Cyber Threat Controls Ontology.png" />

The image appears, and I have enabled "Allow access to file URLs" for this extension.

When I save it with SingleFile, the img data is missing:

<img src="data:base64," alt="Cyber Threat Controls Ontology.png">

This is a regression, there was no such problem in previous versions.

Thanks in advance for fixing this!

@gildas-lormeau
Copy link
Owner

gildas-lormeau commented Jul 18, 2018

I agree that's a regression. This is due to the fact that this version uses the fetch API instead of XMLHttpRequest to retrieve resource's contents. I'm not sure I will fix this issue though. Can you tell me more about your use case and why you are trying to process pages that are stored on the filesystem? Could a program run on the command line more suited for your needs? (SingleFile can run in NodeJS)

@VladimirAlexiev
Copy link
Author

I have a private doc that I want to make standalone in order to send it to a client. I don't want to publish it.

  • So fetch doesn't support local files?
  • Sure, I got node and npm installed and can use them
  • Or I could run a local web server (I've done this once with python's simplehttpserver or whatever was the name)

But using a browser addon is a lot easier for your average user.

@gildas-lormeau
Copy link
Owner

gildas-lormeau commented Jul 23, 2018

Thanks for your response. Unfortunately, the spec does not explicitly says if file: is supported by fetch. Currently, only http and https are supported in Chrome.

However, I think I will replace fetch with XHR in the extension implementation because the API which allows to cancel a fetch request is still very fresh and is maybe not supported by all browsers.

In short term, I recommend you to use a Web Server.

PS: I'm on holidays, I'll be back in one week approximately.

@gildas-lormeau
Copy link
Owner

gildas-lormeau commented Jul 28, 2018

Fixed with 5ba3e404c279fe70d7f1b98a6547cd664c664b2e

@VladimirAlexiev
Copy link
Author

@gildas-lormeau could you let me know when you release this fix to the Google app store? Thanks!

@gildas-lormeau
Copy link
Owner

gildas-lormeau commented Jul 29, 2018

@VladimirAlexiev It is already deployed on the Google app store.

@VladimirAlexiev
Copy link
Author

@gildas-lormeau Then v1.2.17 (29 July 2018) still has the same defect.
Chrome Version 67.0.3396.99

@gildas-lormeau
Copy link
Owner

gildas-lormeau commented Jul 29, 2018

@VladimirAlexiev Please unzip this file, open test/index.html, process it with SingleFile and confirm it's not working for you? Make sure that "Allow access to file URLs" option is checked in the details page (chrome://extensions/?id=mpiodijhokgodhhofbcjdecpffjipkle) of the extension.

@VladimirAlexiev
Copy link
Author

@gildas-lormeau Rechecked now, and everything is ok.
My first image was a broken link, and I didn't scroll down to see the others: sorry to be such a stupid customer, and THANKS for all your care!!

@gildas-lormeau
Copy link
Owner

@VladimirAlexiev No problem, you're welcome :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants