ProxymanApp / ProxymanApp/Proxyman

[Scripting] Support native URL and URLSearchParams

Open
#1,801 1 comment 0 reactions 1 assignee View on GitHub

@NghiaTranUIT is already working on this.

Since Oct 9, 2023.

✅ Done enhancement
Dominant language
No language data
Stars
7k
Forks
237
PR merge metrics
No merged PRs in 30d

Description

Description

Some users complain that this script can't work:

async function onRequest(context, url, request) {
  console.log(url);

  const urlItem = new URL("https://example.com?foo=1&bar=2");
  const params1 = new URLSearchParams(urlItem.search);

  // Done
  return request;
}

and get the following error:

Error: ReferenceError: Can't find variable: URL
Error: ReferenceError: Can't find variable: URLSearchParams

The problem is:

  • URL and URLSearchParams are not natively supported by JavascriptCore framework.

Why this feature/change is important?

  • Can use URL and URLSearchParams
  • Easier to deconstruct the URL and handle the Search Param.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.