Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
AfzalSabbir committed Sep 28, 2022
0 parents commit ffa8844
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bootstrap.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions bootstrap.min.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions jquery.min.js

Large diffs are not rendered by default.

Binary file added logo_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
let primaryTarget, primaryStyle, playerTarget, playerHeight, playerInterval

window.addEventListener('load', (event) => {
console.log('YouTube - Scrollable Playlist: Loading')

playerInterval = setInterval(() => {
primaryTarget = document.querySelector("#primary")
playerTarget = primaryTarget?.querySelector("#player")

if(playerTarget) {
console.log('YouTube - Scrollable Playlist: playerTarget -->', playerTarget)
clearInterval(playerInterval);
load();

window.addEventListener('resize', function(event) {
load();
}, true);
}
}, 100);
});

function load() {
primaryTarget = document.querySelector("#primary")
primaryStyle = primaryTarget.currentStyle || window.getComputedStyle(primaryTarget)

playerTarget = primaryTarget.querySelector("#player")
playerHeight = playerTarget.offsetHeight

let secondaryTarget = document.querySelector("#secondary")
secondaryTarget.style.height = `${playerHeight + parseInt(primaryStyle.paddingTop)}px`
secondaryTarget.style.overflow = `auto`

console.log('YouTube - Scrollable Playlist: Loaded')
}
13 changes: 13 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"manifest_version": 3,
"name": "YouTube - Scrollable Playlist",
"description": "It'll make playlist scrollable for: https://www.youtube.com/",
"version": "1.0.0",
"icons": { "128": "logo_128.png" },
"content_scripts": [
{
"matches": ["*://www.youtube.com/*", "*://youtube.com/*"],
"js": ["jquery.min.js", "main.js"]
}
]
}
7 changes: 7 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Instruction:
- Visit: chrome://extensions/
- Enable Developer mode ==o
- Click [Load unpacked] button
- Select extracted folder
- Extension: "YouTube Scrollable Playlist" should be listed
- You can always disable this from extesion detials

0 comments on commit ffa8844

Please sign in to comment.