mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-13 22:40:01 -04:00
support url base
This commit is contained in:
parent
a1ce4e33b3
commit
7a9c990b01
32 changed files with 213 additions and 158 deletions
|
@ -2,25 +2,34 @@ import { config } from "../../shared";
|
|||
import { ScramjetClient } from "../client";
|
||||
|
||||
export const enabled = () => config.flags.captureErrors;
|
||||
export function argdbg(arg, recurse = []) {
|
||||
switch (typeof arg) {
|
||||
case "string":
|
||||
if (arg.includes("localhost:1337/scramjet/") && arg.includes("m3u8"))
|
||||
debugger;
|
||||
break;
|
||||
case "object":
|
||||
// if (arg instanceof Location) debugger;
|
||||
if (
|
||||
arg &&
|
||||
arg[Symbol.iterator] &&
|
||||
typeof arg[Symbol.iterator] === "function"
|
||||
)
|
||||
for (let prop in arg) {
|
||||
// make sure it's not a getter
|
||||
let desc = Object.getOwnPropertyDescriptor(arg, prop);
|
||||
if (desc && desc.get) continue;
|
||||
|
||||
const ar = arg[prop];
|
||||
if (recurse.includes(ar)) continue;
|
||||
recurse.push(ar);
|
||||
argdbg(ar, recurse);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
export default function (client: ScramjetClient, self: typeof globalThis) {
|
||||
function argdbg(arg) {
|
||||
switch (typeof arg) {
|
||||
case "string":
|
||||
if (arg.includes("scramjet") && !arg.includes("\n")) debugger;
|
||||
break;
|
||||
case "object":
|
||||
if (arg instanceof Location) debugger;
|
||||
if (
|
||||
arg &&
|
||||
arg[Symbol.iterator] &&
|
||||
typeof arg[Symbol.iterator] === "function"
|
||||
)
|
||||
for (let ar of arg) argdbg(ar);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
self.$scramerr = function scramerr(e) {
|
||||
console.warn("CAUGHT ERROR", e);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue