From 18c7579f044f48d7cea0ad7b38adcda415f70bbd Mon Sep 17 00:00:00 2001 From: Stephan Yelle Date: Tue, 9 Dec 2025 22:07:45 -0500 Subject: [PATCH] Update samy.ps1 --- samy.ps1 | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/samy.ps1 b/samy.ps1 index b700070..31e0f8c 100644 --- a/samy.ps1 +++ b/samy.ps1 @@ -1068,13 +1068,15 @@ function Get-UIHtml { $cssContent = Get-RemoteText -Url $Script:SamyCssUrl $jsContent = Get-RemoteText -Url $Script:SamyJsUrl - # Make the CSS background-image follow $Script:SamyBgLogoUrl - if ($cssContent) { - $pattern = 'background-image:\s*url\("SAMY\.png"\);?' # matches with or without extra spaces/semicolon - $replacement = "background-image: url('$Script:SamyBgLogoUrl');" - $cssContent = [regex]::Replace($cssContent, $pattern, $replacement) - } - + if ($cssContent) { + $cssContent += @" + +/* SAMY background override injected by script */ +.sidebar::after { + background-image: url('$Script:SamyBgLogoUrl') !important; +} +"@ +} # # 4) HTML template - **no external link/script src** anymore, all inlined