mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-14 15:00:01 -04:00
unrewriteBlob parity
This commit is contained in:
parent
dc0a2c6d12
commit
3100d07609
3 changed files with 22 additions and 8 deletions
|
@ -5,6 +5,7 @@ import { URLMeta, rewriteUrl } from "./url";
|
|||
import { rewriteCss } from "./css";
|
||||
import { rewriteJs } from "./js";
|
||||
import { CookieStore } from "../cookie";
|
||||
import { unrewriteBlob } from "../../shared";
|
||||
|
||||
export function rewriteHtml(
|
||||
html: string,
|
||||
|
@ -120,8 +121,6 @@ export const htmlRules: {
|
|||
"image",
|
||||
"iframe",
|
||||
"source",
|
||||
"video",
|
||||
"audio",
|
||||
"input",
|
||||
"track",
|
||||
],
|
||||
|
@ -132,6 +131,17 @@ export const htmlRules: {
|
|||
poster: ["video"],
|
||||
"xlink:href": ["image"],
|
||||
},
|
||||
{
|
||||
fn: (value: string, meta: URLMeta) => {
|
||||
if (value.startsWith("blob:")) {
|
||||
// for media elements specifically they must take the original blob
|
||||
// because they can't be fetch'd
|
||||
return unrewriteBlob(value);
|
||||
}
|
||||
return rewriteUrl(value, meta);
|
||||
},
|
||||
src: ["video", "audio"],
|
||||
},
|
||||
{
|
||||
fn: () => null,
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue