Skip to content

Commit

Permalink
debug4 - doesnt fix it, but makes it nicer
Browse files Browse the repository at this point in the history
  • Loading branch information
Mug committed Sep 20, 2022
1 parent 2160577 commit 1c542b6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
6 changes: 2 additions & 4 deletions src/Chapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import axios from "axios";
import API, { CORS_BYPASS } from "./MangaDexAPI/API";
import { IntArray, APlaceholder } from "./utility";

// WebWorker helper class
import WebWorker from "./WebWorker";
// Your web worker
import ImgWorker from "./ImgWorker";

Expand Down Expand Up @@ -199,8 +197,8 @@ class ReaderMain extends React.Component {
this.webWorker.terminate();
}

this.webWorker = new WebWorker(ImgWorker);
//this.webWorker=new window.Worker(worker);
//this.webWorker = new WebWorker(ImgWorker);
this.webWorker=new window.Worker(ImgWorker);

this.webWorker.postMessage({msg: {
cmd: "fetch",
Expand Down
10 changes: 8 additions & 2 deletions src/ImgWorker.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default function ImgWorker(args) {
const worker = () => {
let reportImg = (event,r,time,size,url,success) => {
console.log(r.headers);
console.log("reportImg", {
Expand Down Expand Up @@ -83,4 +83,10 @@ export default function ImgWorker(args) {
}
}
};
}
}

let code = worker.toString();
code = code.substring(code.indexOf("{") + 1, code.lastIndexOf("}"));

const blob = new Blob([code], { type: "application/javascript" });
export default URL.createObjectURL(blob);
9 changes: 0 additions & 9 deletions src/WebWorker.js

This file was deleted.

0 comments on commit 1c542b6

Please sign in to comment.