Giter Club home page Giter Club logo

Comments (3)

faroutchris avatar faroutchris commented on June 6, 2024 3

Same issue in a Vue app.

The problem is that parseDomain main function returns an es6 object literal with shorthand syntax.

return {
  tld,
  domain,
  subdomain
}

This is unsupported in es5 and honestly shouldn't be shipped untranspiled.

from parse-domain.

subatomicglue avatar subatomicglue commented on June 6, 2024 1

Changing to tldjs npm package fixes the problem for us!
We can now parse the domain (domain + tld) from a hostname (subdomain + domain + tld) once again, and IE11 does not hang/freeze on load of our Angular 5.1 app.

Our common.ts:

const tldjs = require('tldjs');

export class Common {
   static parseDomain( data ) {
    var    a      = document.createElement('a');
           a.href = data;
    let domain = tldjs.getDomain( a.hostname );
    return domain;
  }
}

from parse-domain.

jhnns avatar jhnns commented on June 6, 2024

The spinner was probably due to parsing issues with large regexes. parse-domain > 2.1.0 uses a trie structure which is smaller and easier to parse.

The ES6 problem should be fixed with v2.1.5.

from parse-domain.

Related Issues (20)

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.