diff --git a/core/modules/path/src/Tests/PathAliasTest.php b/core/modules/path/src/Tests/PathAliasTest.php
index 7a58787..fd0cd87 100644
--- a/core/modules/path/src/Tests/PathAliasTest.php
+++ b/core/modules/path/src/Tests/PathAliasTest.php
@@ -233,6 +233,11 @@ function testNodeAlias() {
     // Create test node.
     $node1 = $this->drupalCreateNode();
 
+    // Get node and check drupalSettings.
+    $node1 = $this->drupalCreateNode();
+    $this->drupalGet('node/' . $node1->id());
+    $this->assertIdentical($this->getDrupalSettings()['path']['currentPath'], 'node/' . $node1->id());
+
     // Create alias.
     $edit = array();
     $edit['path[0][alias]'] = '/' . $this->randomMachineName(8);
@@ -242,6 +247,7 @@ function testNodeAlias() {
     $this->drupalGet($edit['path[0][alias]']);
     $this->assertText($node1->label(), 'Alias works.');
     $this->assertResponse(200);
+    $this->assertIdentical($this->getDrupalSettings()['path']['currentPathUrlAlias'], substr($edit['path[0][alias]'], 1));
 
     // Confirm the 'canonical' and 'shortlink' URLs.
     $elements = $this->xpath("//link[contains(@rel, 'canonical') and contains(@href, '" . $edit['path[0][alias]'] . "')]");
@@ -307,6 +313,7 @@ function testNodeAlias() {
     $this->drupalGet(trim($edit['path[0][alias]'], '/'));
     $this->assertText($node3->label(), 'Alias became relative.');
     $this->assertResponse(200);
+    $this->assertIdentical($this->getDrupalSettings()['path']['currentPathUrlAlias'], substr($edit['path[0][alias]'], 1));
 
     // Create fourth test node.
     $node4 = $this->drupalCreateNode();
@@ -319,6 +326,7 @@ function testNodeAlias() {
     $this->drupalGet(trim($edit['path[0][alias]'], '/'));
     $this->assertText($node4->label(), 'Alias trimmed trailing slash.');
     $this->assertResponse(200);
+    $this->assertIdentical($this->getDrupalSettings()['path']['currentPathUrlAlias'], trim(substr($edit['path[0][alias]'], 1), '/'));
   }
 
   /**
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index 85f55ed..c1609e6 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -691,11 +691,21 @@ function system_js_settings_alter(&$settings, AttachedAssetsInterface $assets) {
     $route_match = $route_match->getMasterRouteMatch();
   }
   $current_path = $route_match->getRouteName() ? Url::fromRouteMatch($route_match)->getInternalPath() : '';
+  if (!empty($current_path)) {
+    $current_path_url_alias = substr($request->getPathInfo(), 1);
+    if ($pathPrefix && strpos($current_path_url_alias, $pathPrefix) === 0) {
+      $current_path_url_alias = substr_replace($current_path_url_alias, '', 0, strlen($pathPrefix));
+    }
+  }
+  else {
+    $current_path_url_alias = '';
+  }
   $current_path_is_admin = \Drupal::service('router.admin_context')->isAdminRoute($route_match->getRouteObject());
   $path_settings = [
     'baseUrl' => $request->getBaseUrl() . '/',
     'pathPrefix' => $pathPrefix,
     'currentPath' => $current_path,
+    'currentPathUrlAlias' => $current_path_url_alias,
     'currentPathIsAdmin' => $current_path_is_admin,
     'isFront' => \Drupal::service('path.matcher')->isFrontPage(),
     'currentLanguage' => \Drupal::languageManager()->getCurrentLanguage(LanguageInterface::TYPE_URL)->getId(),
