tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

file_url.sys.mjs (586B)


      1 export function checkFromESM(ok, is) {
      2  var url = new URL("https://www.example.com");
      3  is(url.href, "https://www.example.com/", "ESM should have URL");
      4 
      5  var url2 = new URL("/foobar", url);
      6  is(
      7    url2.href,
      8    "https://www.example.com/foobar",
      9    "ESM should have URL - based on another URL"
     10  );
     11 
     12  var blob = new Blob(["a"]);
     13  url = URL.createObjectURL(blob);
     14  ok(url, "URL is created!");
     15 
     16  var u = new URL(url);
     17  ok(u, "URL created");
     18  is(u.origin, "null", "Url doesn't have an origin if created in a ESM");
     19 
     20  URL.revokeObjectURL(url);
     21  ok(true, "URL is revoked");
     22 }