Amazon-Vine-Explorer / AmazonVineExplorer

Makes the Amazon Vine Website evan a bit better
MIT License
16 stars 8 forks source link

Fix broken exportDatabase() #31

Closed numericOverflow closed 1 month ago

numericOverflow commented 2 months ago

This fixes #23

The issue is that different browsers have different limits on what you can export using the href="data:text,fileContentGoesHere" trick to download data. I'm guessing this may explain why you couldn't reproduce? I had the issue on FF v125. The old export code just silently failed and didn't export anything or throw an error.

Length limitations

Browsers are not required to support any particular maximum length of data. For example, the Opera 11 browser limited URLs to 65535 characters long which limits data URLs to 65529 characters (65529 characters being the length of the encoded data, not the source, if you use the plain data:, without specifying a MIME type). Firefox version 97 and newer supports data URLs of up to 32MB (before 97 the limit was close to 256MB). Chromium objects to URLs over 512MB, and Webkit (Safari) to URLs over 2048MB.

This should prevent issue going forward. The new class file save/export limits are much larger: https://github.com/eligrey/FileSaver.js?tab=readme-ov-file#filesaverjs

Christof121 commented 1 month ago

Hello there, sorry for the relatively late reply, just got a little busy.

Here the FileSaver.js "library" is used, which is not a problem in itself, but it would be nice if the included file is readable. I have changed the resource, the function has not changed.

// @require https://raw.githubusercontent.com/eligrey/FileSaver.js/v2.0.4/src/FileSaver.js

Tampermonkey allows the reading of local files, but not in Firefox (possibly also other browsers), so in this case a local web server is an alternative.

Translated with DeepL.com (free version)