Full screen mode activated

This commit is contained in:
amd64fox
2021-12-06 06:40:30 +03:00
parent d69b95262b
commit 3da3216b85
3 changed files with 40 additions and 36 deletions

View File

@@ -180,22 +180,22 @@ $xpui_js_patch = "$env:APPDATA\Spotify\Apps\xpui\xpui.js"
If (Test-Path $xpui_js_patch) {
Write-Host "Spicetify detected"`n
$xpui_js = Get-Content $xpui_js_patch -Raw
If (!($xpui_js -match 'patched by spotx')) {
Copy-Item $xpui_js_patch "$xpui_js_patch.bak"
$xpui_js -match 'visible:!e}[)]{1}[,]{1}[A-Za-z]{1}[(]{1}[)]{1}.createElement[(]{1}[A-Za-z]{2}[,]{1}null[)]{1}[,]{1}[A-Za-z]{1}[(]{1}[)]{1}.' | Out-Null
$menu_split_js = $Matches[0] -split 'createElement[(]{1}[A-Za-z]{2}[,]{1}null[)]{1}[,]{1}[A-Za-z]{1}[(]{1}[)]{1}.'
$new_js = $xpui_js `
<# Removing "Upgrade button" #> -replace ">=1024", ">=1000024" `
<# Removing an empty block #> -replace 'adsEnabled:!0', 'adsEnabled:!1' `
<# Removing "Upgrade to premium" menu #> -replace 'visible:!e}[)]{1}[,]{1}[A-Za-z]{1}[(]{1}[)]{1}.createElement[(]{1}[A-Za-z]{2}[,]{1}null[)]{1}[,]{1}[A-Za-z]{1}[(]{1}[)]{1}.', $menu_split_js `
<# Disabling a playlist sponsor #> -replace "allSponsorships", ""
<# Removing an empty block #> `
-replace 'adsEnabled:!0', 'adsEnabled:!1' `
<# Full screen mode activation and removing "Upgrade to premium" menu, upgrade button #> `
-replace '(session[,]{1}[a-z]{1}[=]{1}[a-z]{1}[=]{1}[>]{1}[{]{1}var [a-z]{1}[,]{1}[a-z]{1}[,]{1}[a-z]{1}[;]{1}[a-z]{6})(["]{1}free["]{1})', '$1"premium"' `
-replace '([a-z]{1}[.]{1}toLowerCase[(]{1}[)]{2}[}]{1}[,]{1}[a-z]{1}[=]{1}[a-z]{1}[=]{1}[>]{1}[{]{1}var [a-z]{1}[,]{1}[a-z]{1}[,]{1}[a-z]{1}[;]{1}return)(["]{1}premium["]{1})', '$1"free"' `
<# Disabling a playlist sponsor #>`
-replace "allSponsorships", ""
# Disable Podcast
if ($Podcasts_off) {
@@ -244,14 +244,16 @@ If (Test-Path $xpui_spa_patch) {
$xpuiContents = $reader.ReadToEnd()
$reader.Close()
$xpuiContents -match 'visible:!e}[)]{1}[,]{1}[A-Za-z]{1}[(]{1}[)]{1}.createElement[(]{1}[A-Za-z]{2}[,]{1}null[)]{1}[,]{1}[A-Za-z]{1}[(]{1}[)]{1}.' | Out-Null
$menu_split_js = $Matches[0] -split 'createElement[(]{1}[A-Za-z]{2}[,]{1}null[)]{1}[,]{1}[A-Za-z]{1}[(]{1}[)]{1}.'
$xpuiContents = $xpuiContents `
<# Removing "Upgrade button" #> -replace ">=1024", ">=1000024" `
<# Removing an empty block #> -replace 'adsEnabled:!0', 'adsEnabled:!1' `
<# Removing "Upgrade to premium" menu #> -replace 'visible:!e}[)]{1}[,]{1}[A-Za-z]{1}[(]{1}[)]{1}.createElement[(]{1}[A-Za-z]{2}[,]{1}null[)]{1}[,]{1}[A-Za-z]{1}[(]{1}[)]{1}.', $menu_split_js `
<# Disabling a playlist sponsor #> -replace "allSponsorships", "" `
<# Disable Logging #> -replace "sp://logging/v3/\w+", ""
<# Removing an empty block #> `
-replace 'adsEnabled:!0', 'adsEnabled:!1' `
<# Full screen mode activation and removing "Upgrade to premium" menu, upgrade button #> `
-replace '(session[,]{1}[a-z]{1}[=]{1}[a-z]{1}[=]{1}[>]{1}[{]{1}var [a-z]{1}[,]{1}[a-z]{1}[,]{1}[a-z]{1}[;]{1}[a-z]{6})(["]{1}free["]{1})', '$1"premium"' `
-replace '([a-z]{1}[.]{1}toLowerCase[(]{1}[)]{2}[}]{1}[,]{1}[a-z]{1}[=]{1}[a-z]{1}[=]{1}[>]{1}[{]{1}var [a-z]{1}[,]{1}[a-z]{1}[,]{1}[a-z]{1}[;]{1}return)(["]{1}premium["]{1})', '$1"free"' `
<# Disabling a playlist sponsor #>`
-replace "allSponsorships", "" `
<# Disable Logging #>`
-replace "sp://logging/v3/\w+", ""
# Disable Podcast
if ($Podcasts_off) {
@@ -625,4 +627,4 @@ if ($ch -eq 'u') {
}
}
exit
exit

View File

@@ -181,22 +181,21 @@ $xpui_js_patch = "$env:APPDATA\Spotify\Apps\xpui\xpui.js"
If (Test-Path $xpui_js_patch) {
Write-Host "Обнаружен Spicetify"`n
$xpui_js = Get-Content $xpui_js_patch -Raw
$xpui_js = Get-Content $xpui_js_patch -Raw
If (!($xpui_js -match 'patched by spotx')) {
Copy-Item $xpui_js_patch "$xpui_js_patch.bak"
$xpui_js -match 'visible:!e}[)]{1}[,]{1}[A-Za-z]{1}[(]{1}[)]{1}.createElement[(]{1}[A-Za-z]{2}[,]{1}null[)]{1}[,]{1}[A-Za-z]{1}[(]{1}[)]{1}.' | Out-Null
$menu_split_js = $Matches[0] -split 'createElement[(]{1}[A-Za-z]{2}[,]{1}null[)]{1}[,]{1}[A-Za-z]{1}[(]{1}[)]{1}.'
$new_js = $xpui_js `
<# Removing "Upgrade button" #> -replace ">=1024", ">=1000024" `
<# Removing an empty block #> -replace 'adsEnabled:!0', 'adsEnabled:!1' `
<# Removing "Upgrade to premium" menu #> -replace 'visible:!e}[)]{1}[,]{1}[A-Za-z]{1}[(]{1}[)]{1}.createElement[(]{1}[A-Za-z]{2}[,]{1}null[)]{1}[,]{1}[A-Za-z]{1}[(]{1}[)]{1}.', $menu_split_js `
<# Disabling a playlist sponsor #> -replace "allSponsorships", ""
<# Removing an empty block #> `
-replace 'adsEnabled:!0', 'adsEnabled:!1' `
<# Full screen mode activation and removing "Upgrade to premium" menu, upgrade button #> `
-replace '(session[,]{1}[a-z]{1}[=]{1}[a-z]{1}[=]{1}[>]{1}[{]{1}var [a-z]{1}[,]{1}[a-z]{1}[,]{1}[a-z]{1}[;]{1}[a-z]{6})(["]{1}free["]{1})', '$1"premium"' `
-replace '([a-z]{1}[.]{1}toLowerCase[(]{1}[)]{2}[}]{1}[,]{1}[a-z]{1}[=]{1}[a-z]{1}[=]{1}[>]{1}[{]{1}var [a-z]{1}[,]{1}[a-z]{1}[,]{1}[a-z]{1}[;]{1}return)(["]{1}premium["]{1})', '$1"free"' `
<# Disabling a playlist sponsor #>`
-replace "allSponsorships", ""
# Disable Podcast
if ($Podcasts_off) {
@@ -245,14 +244,16 @@ If (Test-Path $xpui_spa_patch) {
$xpuiContents = $reader.ReadToEnd()
$reader.Close()
$xpuiContents -match 'visible:!e}[)]{1}[,]{1}[A-Za-z]{1}[(]{1}[)]{1}.createElement[(]{1}[A-Za-z]{2}[,]{1}null[)]{1}[,]{1}[A-Za-z]{1}[(]{1}[)]{1}.' | Out-Null
$menu_split_js = $Matches[0] -split 'createElement[(]{1}[A-Za-z]{2}[,]{1}null[)]{1}[,]{1}[A-Za-z]{1}[(]{1}[)]{1}.'
$xpuiContents = $xpuiContents `
<# Removing "Upgrade button" #> -replace ">=1024", ">=1000024" `
<# Removing an empty block #> -replace 'adsEnabled:!0', 'adsEnabled:!1' `
<# Removing "Upgrade to premium" menu #> -replace 'visible:!e}[)]{1}[,]{1}[A-Za-z]{1}[(]{1}[)]{1}.createElement[(]{1}[A-Za-z]{2}[,]{1}null[)]{1}[,]{1}[A-Za-z]{1}[(]{1}[)]{1}.', $menu_split_js `
<# Disabling a playlist sponsor #> -replace "allSponsorships", "" `
<# Disable Logging #> -replace "sp://logging/v3/\w+", ""
<# Removing an empty block #> `
-replace 'adsEnabled:!0', 'adsEnabled:!1' `
<# Full screen mode activation and removing "Upgrade to premium" menu, upgrade button #> `
-replace '(session[,]{1}[a-z]{1}[=]{1}[a-z]{1}[=]{1}[>]{1}[{]{1}var [a-z]{1}[,]{1}[a-z]{1}[,]{1}[a-z]{1}[;]{1}[a-z]{6})(["]{1}free["]{1})', '$1"premium"' `
-replace '([a-z]{1}[.]{1}toLowerCase[(]{1}[)]{2}[}]{1}[,]{1}[a-z]{1}[=]{1}[a-z]{1}[=]{1}[>]{1}[{]{1}var [a-z]{1}[,]{1}[a-z]{1}[,]{1}[a-z]{1}[;]{1}return)(["]{1}premium["]{1})', '$1"free"' `
<# Disabling a playlist sponsor #>`
-replace "allSponsorships", "" `
<# Disable Logging #>`
-replace "sp://logging/v3/\w+", ""
# Disable Podcast
if ($Podcasts_off) {
@@ -626,4 +627,4 @@ if ($ch -eq 'u') {
}
}
exit
exit

View File

@@ -19,8 +19,9 @@
* <strong>For [Windows Desktop](https://www.spotify.com/download/windows/) only. (Microsoft store version is not suitable)</strong>
* <strong>Blocks all banner, video and audio ads in the client</strong>
* <strong>Unlocks the skip function of any track</strong>
* <strong>Blocks automatic updates (optional)</strong>
* <strong>Full screen mode activated</strong>
* <strong>Podcasts disabled (optional)</strong>
* <strong>Blocks automatic updates (optional)</strong>
* <strong>[Automatic cache clearing](https://github.com/amd64fox/SpotX/discussions/2) (optional)</strong>
* <strong>Disabled Sentry (Prevented Sentry from sending console log/error/warning to Spotify developers)</strong>
* <strong>Disabled logging (Stopped various elements to log user interaction)</strong>