|
@@ -25,19 +25,12 @@ this.SingleFile = (() => {
|
|
|
|
|
|
|
|
// --------
|
|
// --------
|
|
|
// Download
|
|
// Download
|
|
|
- // --------
|
|
|
|
|
- const USER_AGENT = "Mozilla/5.0 (compatible; SingleFile Bot/1.0)";
|
|
|
|
|
-
|
|
|
|
|
|
|
+ // --------
|
|
|
let fetchResource;
|
|
let fetchResource;
|
|
|
|
|
|
|
|
class Download {
|
|
class Download {
|
|
|
static async getContent(resourceURL, asDataURI) {
|
|
static async getContent(resourceURL, asDataURI) {
|
|
|
- const requestOptions = {
|
|
|
|
|
- method: "GET",
|
|
|
|
|
- headers: {
|
|
|
|
|
- "User-Agent": USER_AGENT
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ const requestOptions = { method: "GET" };
|
|
|
let resourceContent;
|
|
let resourceContent;
|
|
|
if (!fetchResource) {
|
|
if (!fetchResource) {
|
|
|
fetchResource = typeof superFetch == "undefined" ? fetch : superFetch;
|
|
fetchResource = typeof superFetch == "undefined" ? fetch : superFetch;
|