| 1 | export 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 | } |
nothing calls this directly
no outgoing calls
no test coverage detected