Update samy.ps1

This commit is contained in:
2025-12-09 22:03:42 -05:00
parent ab79f78693
commit d884fc8437

View File

@@ -247,7 +247,7 @@ $ConfirmPreference = 'None'
$Script:SamyTopLogoUrl = "$Script:SamyRepoBase/$Script:SamyBranch/SVS_logo.svg"
# Background SAMY image used in CSS
$Script:SamyBgLogoUrl = "$Script:SamyRepoBase/$Script:SamyBranch/SAMY5.png"
$Script:SamyBgLogoUrl = "$Script:SamyRepoBase/$Script:SamyBranch/SAMY5.png?raw=1"
$Script:SamyFaviconUrl = "$Script:SamyRepoBase/$Script:SamyBranch/SVS_Favicon.ico"
$Script:SamyCssUrl = "$Script:SamyRepoBase/$Script:SamyBranch/samy.css?raw=1"
@@ -1068,12 +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\("SAMY5\.png"\);?' # matches with or without extra spaces/semicolon
$replacement = "background-image: url('$Script:SamyBgLogoUrl');"
$cssContent = [regex]::Replace($cssContent, $pattern, $replacement)
}
$cssContent += @"
/* SAMY background override injected by script */
.sidebar::after {
background-image: url('$Script:SamyBgLogoUrl') !important;
}
"@
}
#