sammacbeth / dat-fox

dat:// protocol as a Firefox webextension
MIT License
250 stars 12 forks source link

Locally running an application (not dat), fails saving files when dat-fox extension is enabled #25

Open venikx opened 6 years ago

venikx commented 6 years ago

General information

Domain: localhost:3000 Browser: Firefox 62 OS: Void Linux

Scenario

  1. Start a SPA application (for example using React)
  2. Save a file via the front-end application
  3. Open a file saver popup
  4. File is saved => OK
  5. Enable dat-fox extensions
  6. Save a file via the front-end application

Expected Result

The browser tries to save a file by showing the pop-up to save a file

Actual Result

Saving the file gives an error URL.createObjectURL is not a function (we are using FileSaver.js and that library is throwing that error) and doesn't open the file saver popup.

Extra information

I noticed that this is only a problem when developing locally on the application, when we create a production build and push to our development instance on AWS we don't have this issue. Is the extension overriding browser globals? Is there any weird behavior you can think of using localhost?

If you need any more information, I'll try to provide it for you.

sammacbeth commented 6 years ago

The extension initially assumes the dat gateway is running on localhost:3000, until the process finishes starting up and communicates its actual port. If you are running other services on port 3000 they may have received some requests from the extension in this time. Does this possibly explain your issue?