While using the latest DEV version of extlink module the hosts are not recognized correctly by the js, which is parsing the current window.location.host - i only get the TLD and not the full hostname.

Example:
* URL: https://www.ispo.com/en/munich/press/sports-blogger-at-ispo-munich

Debug output:

While using the Exclude links with the same primary domain. and Open external links in a new window. settings on the ispo.com domain this leads to the problem, that all .com are handled as internal domains and won't open in a new window.

As already mentioned in #2914838 the whole subdomain detection seems to be not as reliable as it should be.

SteffenR

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

SteffenR created an issue. See original summary.

SteffenR’s picture

Assigned: SteffenR » Unassigned
Status: Active » Needs review
FileSize
6.42 KB

Attached you find a patch solving the issue.

SteffenR’s picture

FileSize
6.39 KB

Fixing new line issue in minified javascript.

SteffenR’s picture

Title: Host not recognized correctly while parsing urls » Host not recognized correctly while parsing domain name
Issue summary: View changes
Berdir’s picture

Status: Needs review » Reviewed & tested by the community

Can confirm this, patch seems to work well.

  • elachlan committed 37b884e on 8.x-1.x authored by SteffenR
    Issue #2921495 by SteffenR, Berdir: Host not recognized correctly while...
elachlan’s picture

Status: Reviewed & tested by the community » Needs work

I've pushed through the change to extlink.js, but the minified file needs to be re-rolled.

Berdir’s picture

@elachlan: Related question? Does it *really* make sense to keep maintaining that file at all? It's quite a pain to reroll patches because of that and it's the only file in all core/contrib modules that I use that is like that. It's really not that big, so can't make such a difference?

elachlan’s picture

Status: Needs work » Fixed

Yeah I am not even sure if its used to be honest. I believe Drupal will minify it anyway. I think it was for some specific case when someone asked for it.

Marking this as fixed.

Berdir’s picture

afaik it is currently still used, so this isn't really fixed, but I'll open an issue to remove it then.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

dpagini’s picture

Sorry to comment on a closed issue.. was a follow up issue ever opened for removing the minified js?