Giter Site home page Giter Site logo

url-parser's People

Contributors

chrmod avatar dependabot-preview[bot] avatar remusao avatar sammacbeth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

url-parser's Issues

fails to detect invalid URL

The following URL is accepted by @cliqz/url-parser but rejected by URL constructor in Firefox/Node.js: http://data:text/plain;charset=UTF-8;page=21,the%20data:1234,5678.

handle ipv6

Currently fails to handle ipv6 (e.g.: https://[::1]).

Unable to set querystring

For the following snippet,

let url = new URL('https://github.com');
url.searchParams.set('key', 'value');
console.log(url.href);

Standard URL returns https://github.com/?key=value while url-parser gives me https://github.com.

If this is out of the scope of this library (I guess is being a super fast parser), feel free to close the issue.

TLD parsing options

Currently the hostname is parsed using default tldts options. In practice we may want to pass options such as allowPrivateDomains when parsing the hostname.

We could, for example, add an optional argument to the URL constructor with the tldts IOptions for tldts.parse. Alternatively we could expose a global that sets the options for all URLs created by the application.

[question] new URL(...).origin === "null" for unknown/custom schemes (not this module but browser/node)

In node/browser when native URL used the call like this new URL("webclient://domain.net/blank.html?loader-id=2fb1c580").origin returns "null" (notice unknowns/custom scheme). This library returns the value regardless the scheme and I like such behavior.

The questions:

  • Is this module planning returning "null" for unknown/custom schemes like node & browser do?
  • Maybe there is a link to documentation which covers the described "null" case?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.