diff --git a/ilc/package-lock.json b/ilc/package-lock.json index 19df79b8..872a2baf 100644 --- a/ilc/package-lock.json +++ b/ilc/package-lock.json @@ -10,7 +10,7 @@ "license": "Apache-2.0", "dependencies": { "@namecheap/error-extender": "^2.2.1", - "@namecheap/tailorx": "^8.1.0", + "@namecheap/tailorx": "^8.2.0", "@newrelic/native-metrics": "^11.0.0", "agentkeepalive": "^4.5.0", "axios": "^1.7.7", @@ -2195,9 +2195,10 @@ "integrity": "sha512-GeFZT8ntXN7N91jyHy7qEw4Kq0v66kV/7+/EQJHHsdzbko44wtrDvr+Mj6Td9soqlZGQz8VoOUa9XrHSauVcLA==" }, "node_modules/@namecheap/tailorx": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@namecheap/tailorx/-/tailorx-8.1.0.tgz", - "integrity": "sha512-TSCfaKfUd14QQkZrZHYIP/vj5zONxhCNtpTkpd15BN0XPl2idHwJFBDaNgKqGh/iZiHesCcXMsM6sQRIgizmKg==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@namecheap/tailorx/-/tailorx-8.2.0.tgz", + "integrity": "sha512-RAeOeaiw1btqowbkc5BfklXGBFUw4R4SkVCFNAVxEj9Hc/qaeo1SnDF99MI8nTiixefaZCWvyHhcp8R0/iwO3A==", + "license": "Apache-2.0", "dependencies": { "@namecheap/error-extender": "^2.0.0", "agentkeepalive": "^4.5.0", diff --git a/ilc/package.json b/ilc/package.json index 917d067b..9a1ed481 100644 --- a/ilc/package.json +++ b/ilc/package.json @@ -21,7 +21,7 @@ "license": "Apache-2.0", "dependencies": { "@namecheap/error-extender": "^2.2.1", - "@namecheap/tailorx": "^8.1.0", + "@namecheap/tailorx": "^8.2.0", "@newrelic/native-metrics": "^11.0.0", "agentkeepalive": "^4.5.0", "axios": "^1.7.7", diff --git a/ilc/server/tailor/configs-injector.js b/ilc/server/tailor/configs-injector.js index 1965b967..23a7ecef 100644 --- a/ilc/server/tailor/configs-injector.js +++ b/ilc/server/tailor/configs-injector.js @@ -54,15 +54,13 @@ module.exports = class ConfigsInjector { registryConfig.settings?.i18n, ); - const newRelicScript = - !this.#nrAutomaticallyInjectClientScript || request.ldeRelated ? '' : this.#getNewRelicScript(); const headHtmlContent = this.#wrapWithIgnoreDuringParsing( //...routeAssets.scriptLinks, this.#getIlcState(request), this.#getSPAConfig(registryConfig), ``, this.#wrapWithAsyncScriptTag(this.#getClientjsUrl()), - newRelicScript, + this.#getNewRelicScript(), hrefLangHtml, canonicalTagHtml, ); @@ -75,6 +73,10 @@ module.exports = class ConfigsInjector { request.styleRefs = this.#getRouteStyleRefsToPreload(registryConfig.apps, slots, template.styleRefs); + if (request.ldeRelated) { + document = this.#wrapTagsToRemove(document, /`; - newrelic.getBrowserTimingHeader.withArgs().returns(browserTimingHeader); + const nrHeader = ``; + const expectedHeader = `${nrHeader}` const configsInjector = new ConfigsInjector(newrelic); const request = { registryConfig, ilcState: { locale: 'en-US' }, ldeRelated: true }; const template = { @@ -447,6 +451,7 @@ describe('configs injector', () => { content: '' + '
' + + nrHeader + '' + '