diff options
Diffstat (limited to 'src/assets/javascripts/persist-invidious-prefs.js')
-rw-r--r-- | src/assets/javascripts/persist-invidious-prefs.js | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/assets/javascripts/persist-invidious-prefs.js b/src/assets/javascripts/persist-invidious-prefs.js index 4c13a310..dff2dd5a 100644 --- a/src/assets/javascripts/persist-invidious-prefs.js +++ b/src/assets/javascripts/persist-invidious-prefs.js @@ -1,23 +1,23 @@ -'use strict'; +"use strict"; window.browser = window.browser || window.chrome; function getCookie() { - let ca = document.cookie.split(';'); + let ca = document.cookie.split(";"); for (let i = 0; i < ca.length; i++) { let c = ca[i]; - while (c.charAt(0) == ' ') c = c.substring(1, c.length); - if (c.indexOf('PREFS=') == 0) { + while (c.charAt(0) == " ") c = c.substring(1, c.length); + if (c.indexOf("PREFS=") == 0) { return JSON.parse( - decodeURIComponent(c.substring('PREFS='.length, c.length)) - ) - }; + decodeURIComponent(c.substring("PREFS=".length, c.length)) + ); + } } return {}; } browser.storage.sync.get( - ['alwaysProxy', 'videoQuality', 'invidiousDarkMode', 'persistInvidiousPrefs'], + ["alwaysProxy", "videoQuality", "invidiousDarkMode", "persistInvidiousPrefs"], (result) => { if (result.persistInvidiousPrefs) { const prefs = getCookie(); @@ -27,4 +27,4 @@ browser.storage.sync.get( document.cookie = `PREFS=${encodeURIComponent(JSON.stringify(prefs))}`; } } -); \ No newline at end of file +); |