aboutsummaryrefslogtreecommitdiff
path: root/app/loadcss.js
diff options
context:
space:
mode:
authorSowgro <69283684+Sowgro@users.noreply.github.com>2023-09-15 20:53:52 -0400
committerGitHub <noreply@github.com>2023-09-15 20:53:52 -0400
commit4d041a58a53f2bad9ccc90645b179bc787f7173d (patch)
tree2bfa5e684817713918dc0ef53181e66903e4e12d /app/loadcss.js
parent7e1699a57a0e62b88581a9603ba14171d8297098 (diff)
downloadbetterLibrary-4d041a58a53f2bad9ccc90645b179bc787f7173d.tar.gz
betterLibrary-4d041a58a53f2bad9ccc90645b179bc787f7173d.tar.bz2
betterLibrary-4d041a58a53f2bad9ccc90645b179bc787f7173d.zip
Bug fixes
Diffstat (limited to 'app/loadcss.js')
-rw-r--r--app/loadcss.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/loadcss.js b/app/loadcss.js
index 57f002e..184b445 100644
--- a/app/loadcss.js
+++ b/app/loadcss.js
@@ -2,4 +2,11 @@
document.getElementsByTagName('head')[0].insertAdjacentHTML(
'beforeend',
'<link rel="stylesheet" href="spicetify-routes-betterlibrary.css" />');
+ // disable after window is closed to prevent an expanded sidebar on opening
+ window.addEventListener(
+ 'beforeunload',
+ (event) => {
+ disableBetterLib();
+ }
+ )
})(); \ No newline at end of file