diff --git a/typo3/sysext/backend/Classes/Controller/BackendController.php b/typo3/sysext/backend/Classes/Controller/BackendController.php
index 2c5200d2db7e5267e9b8fc21e3a295fcb39d134e..e4d689f2e6b84f511e38b08194f3f175039241e6 100644
--- a/typo3/sysext/backend/Classes/Controller/BackendController.php
+++ b/typo3/sysext/backend/Classes/Controller/BackendController.php
@@ -626,23 +626,12 @@ class BackendController
         }
         $t3Configuration = [
             'username' => htmlspecialchars($beUser->user['username']),
-            'uniqueID' => GeneralUtility::shortMD5(uniqid('', true)),
             'pageModule' => $pageModule,
             'inWorkspace' => $beUser->workspace !== 0,
             'showRefreshLoginPopup' => isset($GLOBALS['TYPO3_CONF_VARS']['BE']['showRefreshLoginPopup']) ? (int)$GLOBALS['TYPO3_CONF_VARS']['BE']['showRefreshLoginPopup'] : false
         ];
         $this->js .= '
 	TYPO3.configuration = ' . json_encode($t3Configuration) . ';
-
-	/**
-	 * TypoSetup object.
-	 */
-	function typoSetup() {	//
-		this.username = TYPO3.configuration.username;
-		this.uniqueID = TYPO3.configuration.uniqueID;
-	}
-	var TS = new typoSetup();
-		//backwards compatibility
 	/**
 	 * Frameset Module object
 	 *
@@ -651,12 +640,11 @@ class BackendController
 	 *		if (top.fsMod) top.fsMod.recentIds["web"] = "\'.(int)$this->id.\'";
 	 * 		if (top.fsMod) top.fsMod.recentIds["file"] = "...(file reference/string)...";
 	 */
-	function fsModules() {	//
-		this.recentIds=new Array();					// used by frameset modules to track the most recent used id for list frame.
-		this.navFrameHighlightedID=new Array();		// used by navigation frames to track which row id was highlighted last time
-		this.currentBank="0";
-	}
-	var fsMod = new fsModules();
+	var fsMod = {
+		recentIds: [],					// used by frameset modules to track the most recent used id for list frame.
+		navFrameHighlightedID: [],		// used by navigation frames to track which row id was highlighted last time
+		currentBank: "0"
+	};
 
 	top.goToModule = function(modName, cMR_flag, addGetVars) {
 		TYPO3.ModuleMenu.App.showModule(modName, addGetVars);
diff --git a/typo3/sysext/backend/Classes/Controller/EditDocumentController.php b/typo3/sysext/backend/Classes/Controller/EditDocumentController.php
index 844d2eac70ab04e853a542d49d4c278610ea6d98..567490b77d6126432dbe1aecf0f349367af098c5 100644
--- a/typo3/sysext/backend/Classes/Controller/EditDocumentController.php
+++ b/typo3/sysext/backend/Classes/Controller/EditDocumentController.php
@@ -733,39 +733,22 @@ class EditDocumentController extends AbstractModule
 					formEl.checked = formEl.checked ? 0 : 1;
 				}
 			}
-'
-        );
-        $t3Configuration = [];
-
-        $javascript = '
-			TYPO3.configuration = ' . json_encode($t3Configuration) . ';
-			// Object: TS:
-			// TS object overwrites the object declared in tbe_editor.js
-			function typoSetup() {	//
-				this.uniqueID = "";
-			}
-			var TS = new typoSetup();
 
 				// Info view:
-			function launchView(table,uid) {	//
+			function launchView(table,uid) {
 				var thePreviewWindow = window.open(
 					' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('show_item') . '&table=') . ' + encodeURIComponent(table) + "&uid=" + encodeURIComponent(uid),
-					"ShowItem" + TS.uniqueID,
+					"ShowItem" + Math.random().toString(16).slice(2),
 					"height=300,width=410,status=0,menubar=0,resizable=0,location=0,directories=0,scrollbars=1,toolbar=0"
 				);
 				if (thePreviewWindow && thePreviewWindow.focus) {
 					thePreviewWindow.focus();
 				}
 			}
-			function deleteRecord(table,id,url) {	//
+			function deleteRecord(table,id,url) {
 				window.location.href = ' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('tce_db') . '&cmd[') . '+table+"]["+id+"][delete]=1&redirect="+escape(url);
 			}
-		';
-
-        $previewCode = isset($_POST['_savedokview']) && $this->popViewId ? $this->generatePreviewCode() : '';
-        $this->moduleTemplate->addJavaScriptCode(
-            'PreviewCode',
-            $javascript . $previewCode
+		' . (isset($_POST['_savedokview']) && $this->popViewId ? $this->generatePreviewCode() : '')
         );
         // Setting up the context sensitive menu:
         $this->moduleTemplate->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/ContextMenu');
diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/LoginRefresh.js b/typo3/sysext/backend/Resources/Public/JavaScript/LoginRefresh.js
index 02fd17c60d29aa88d7ae265e40d39c794bf8196a..e1a86a235238046d784ff4b2f1edb7cda1c01e4f 100644
--- a/typo3/sysext/backend/Resources/Public/JavaScript/LoginRefresh.js
+++ b/typo3/sysext/backend/Resources/Public/JavaScript/LoginRefresh.js
@@ -278,7 +278,7 @@ define(['jquery', 'TYPO3/CMS/Backend/Notification', 'bootstrap'], function($, Ty
 	 * Opens the login form in a new window.
 	 */
 	LoginRefresh.showLoginPopup = function() {
-		var vHWin = window.open(LoginRefresh.loginFramesetUrl, 'relogin_' + TYPO3.configuration.uniqueID, 'height=450,width=700,status=0,menubar=0,location=1');
+		var vHWin = window.open(LoginRefresh.loginFramesetUrl, 'relogin_' + Math.random().toString(16).slice(2), 'height=450,width=700,status=0,menubar=0,location=1');
 		if (vHWin) {
 			vHWin.focus();
 		}
diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/UserPassLogin.js b/typo3/sysext/backend/Resources/Public/JavaScript/UserPassLogin.js
index 7de688dd658622ca62c57c4963d39d24ea974254..9ca7dc509c653ce87c34fca8a74d1f847c71df9d 100644
--- a/typo3/sysext/backend/Resources/Public/JavaScript/UserPassLogin.js
+++ b/typo3/sysext/backend/Resources/Public/JavaScript/UserPassLogin.js
@@ -94,8 +94,8 @@ define(['jquery', 'TYPO3/CMS/Backend/Login'], function($, Login) {
 		// If the login screen is shown in the login_frameset window for re-login,
 		// then try to get the username of the current/former login from opening windows main frame:
 		try {
-			if (parent.opener && parent.opener.TS && parent.opener.TS.username) {
-				$usernameField.val(parent.opener.TS.username);
+			if (parent.opener && parent.opener.TYPO3 && parent.opener.TYPO3.configuration && parent.opener.TYPO3.configuration.username) {
+				$usernameField.val(parent.opener.TYPO3.configuration.username);
 			}
 		} catch (error) {} // continue
 
diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/backend.js b/typo3/sysext/backend/Resources/Public/JavaScript/backend.js
index b4f82879e3c7a4627907cc6b817b5266c1730de4..dd5778c4233880ecb34b253a3e4e70254fecc451 100644
--- a/typo3/sysext/backend/Resources/Public/JavaScript/backend.js
+++ b/typo3/sysext/backend/Resources/Public/JavaScript/backend.js
@@ -76,7 +76,7 @@ function str_replace(match,replace,string)	{	//
  */
 function launchView(table, uid) {
 	var thePreviewWindow = window.open(TYPO3.settings.ShowItem.moduleUrl + '&table=' + encodeURIComponent(table) + "&uid=" + encodeURIComponent(uid),
-			"ShowItem" + TS.uniqueID,
+			"ShowItem" + Math.random().toString(16).slice(2),
 			"width=650,height=600,status=0,menubar=0,resizable=0,location=0,directories=0,scrollbars=1,toolbar=0");
 	if (thePreviewWindow && thePreviewWindow.focus) {
 		thePreviewWindow.focus();
diff --git a/typo3/sysext/workspaces/Classes/Controller/PreviewController.php b/typo3/sysext/workspaces/Classes/Controller/PreviewController.php
index 7945dcc6d0bbb1c9bb7568e0fa6e2c5cd2fa9a23..29b7659f22adb3bf9ba022a3f38d322324dbffd3 100644
--- a/typo3/sysext/workspaces/Classes/Controller/PreviewController.php
+++ b/typo3/sysext/workspaces/Classes/Controller/PreviewController.php
@@ -217,25 +217,12 @@ class PreviewController extends AbstractController
         }
         $t3Configuration = [
             'username' => htmlspecialchars($backendUser->user['username']),
-            'uniqueID' => GeneralUtility::shortMD5(uniqid('', true)),
             'pageModule' => $pageModule,
             'inWorkspace' => $backendUser->workspace !== 0,
             'showRefreshLoginPopup' => isset($GLOBALS['TYPO3_CONF_VARS']['BE']['showRefreshLoginPopup']) ? (int)$GLOBALS['TYPO3_CONF_VARS']['BE']['showRefreshLoginPopup'] : false
         ];
 
-        return '
-		TYPO3.configuration = ' . json_encode($t3Configuration) . ';
-
-		/**
-		 * TypoSetup object.
-		 */
-		function typoSetup()	{	//
-			this.username = TYPO3.configuration.username;
-			this.uniqueID = TYPO3.configuration.uniqueID;
-		}
-		var TS = new typoSetup();
-			//backwards compatibility
-		';
+        return 'TYPO3.configuration = ' . json_encode($t3Configuration) . ';';
     }
 
     /**