Created
February 15, 2020 19:16
-
-
Save ttonyh/f80913a6c25edb6b906d1acb544523be to your computer and use it in GitHub Desktop.
Bookmarklet - Sets a Youtube Feet view to list mode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( ( w, d, s1, s2, b, cN ) => { | |
const GS = ( src, d ) => { | |
d = document; | |
return new Promise( ( resolve, reject ) => { | |
s = d.createElement( 'script' ); | |
s.type = 'text/javascript'; | |
s.async = true; | |
s.onload = () => resolve(); | |
s.src = src; | |
d.getElementsByTagName( 'head' )[ 0 ].appendChild( s ); | |
}); | |
}; | |
b = 'https://cdn.jsdelivr.net/npm/'; | |
s1 = `${b}js-cookie@2/src/js.cookie.min.js`; | |
s2 = `${b}qss@2.0.3/dist/qss.min.js`; | |
cN = 'PREF'; | |
Promise.all( [ GS( s1 ), GS( s2 ) ] ).then( () => { | |
let pref = Cookies.get( cN ), | |
qs = {}; | |
if ( pref ) { | |
qs = qss.decode( pref ); | |
} | |
qs.cvdm = 'list'; | |
Cookies.set( cN, qss.encode( qs ) ); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment