MCPcopy Create free account
hub / github.com/CanadaHonk/shadow / Page

Class Page

engine/network.js:1–16  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1export class Page {
2 constructor(url) {
3 this.url = url;
4 this.baseURL = url;
5 }
6
7 resolve(input) {
8 return new URL(input, this.baseURL);
9 }
10
11 async fetch(input = '', corsProxy = !input.startsWith('data:') && !input.includes('://localhost')) {
12 let url = this.resolve(input);
13 return await fetch(url);
14 // return await fetch((corsProxy ? 'https://cors-anywhere.com/' : '') + url);
15 }
16}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected