feat(clickTtHttpPageRoutes, ClickTtView): enhance script injection for improved HTML handling

- Added checks to inject the navigation script into the <head> or <body> of HTML responses, ensuring proper script placement for enhanced functionality.
- Updated ClickTtView to include a reference for the iframe, improving access to the iframe element for future interactions.
- Enhanced overall HTML processing during proxy interactions, contributing to a more robust user experience.
This commit is contained in:
Torsten Schulz (local)
2026-03-11 00:06:42 +01:00
parent c40ee04e9e
commit 1398e8911a
2 changed files with 12 additions and 0 deletions

View File

@@ -329,6 +329,14 @@ function injectProxyNavigationScript(html, proxyBaseUrl, pageBaseUrl, sid) {
].join('');
const script = `<script>${scriptContent}<\/script>`;
if (/<head[^>]*>/i.test(html)) {
return html.replace(/<head([^>]*)>/i, `<head$1>${script}`);
}
if (/<body[^>]*>/i.test(html)) {
return html.replace(/<body([^>]*)>/i, `<body$1>${script}`);
}
if (/<\/body>/i.test(html)) {
return html.replace(/<\/body>/i, `${script}</body>`);
}