Browse Source

Forgot build

Anonymous 2 years ago
parent
commit
5ef847c0b1
  1. 2
      main.meta.js
  2. 16
      main.user.js

2
main.meta.js

@ -1,7 +1,7 @@
// ==UserScript==
// @name PNGExtraEmbed2
// @namespace https://coom.tech/
// @version 0.137
// @version 0.145
// @description uhh
// @author You
// @match https://boards.4channel.org/*

16
main.user.js

@ -1,7 +1,7 @@
// ==UserScript==
// @name PNGExtraEmbed2
// @namespace https://coom.tech/
// @version 0.137
// @version 0.145
// @description uhh
// @author You
// @match https://boards.4channel.org/*
@ -15622,15 +15622,15 @@
if (settled)
return;
settled = true;
if (file.thumbnail == null)
const media = typeof file.thumbnail === "function" ? await file.thumbnail() : file.data;
if (media == null)
return;
const thumb = typeof file.thumbnail === "function" ? await file.thumbnail() : file.data;
let type;
if (thumb instanceof Buffer2) {
type = await fileTypeFromBuffer(thumb);
$$invalidate(5, url = URL.createObjectURL(new Blob([thumb], { type: type?.mime })));
} else if (typeof thumb === "string") {
let head = headerStringToObject(await GM_head(thumb, void 0));
if (media instanceof ArrayBuffer || media instanceof Uint8Array) {
type = await fileTypeFromBuffer(media);
$$invalidate(5, url = URL.createObjectURL(new Blob([media], { type: type?.mime })));
} else if (typeof media === "string") {
let head = headerStringToObject(await GM_head(media, void 0));
type = {
ext: "",
mime: head["content-type"].split(";")[0].trim()

Loading…
Cancel
Save