diff --git a/samy.ps1 b/samy.ps1 index 95a01d3..5aaf92f 100644 --- a/samy.ps1 +++ b/samy.ps1 @@ -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; +} +"@ +} #