This commit is contained in:
Ajay Ramachandran 2024-01-18 18:40:37 +00:00 committed by GitHub
commit 5f74ee7bb7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 28 additions and 20 deletions

View File

@ -20,7 +20,8 @@
"content_scripts": [
{
"matches": ["https://www.youtube.com/*"],
"js": ["script.js"]
"js": ["script.js"],
"css": ["script.css"]
}
],
"background": {

View File

@ -18,7 +18,8 @@
"content_scripts": [
{
"matches": ["https://www.youtube.com/*"],
"js": ["script.js"]
"js": ["script.js"],
"css": ["script.css"]
}
],
"background": {

18
extension/script.css Normal file
View File

@ -0,0 +1,18 @@
.ta-button {
display: flex;
align-items: center;
justify-content: center;
background-color: #00202f;
color: #fff;
font-size: 1.4rem;
text-decoration: none;
border-radius: 8px;
cursor: pointer;
height: fit-content;
opacity: 0;
}
.ta-title-container {
display: flex;
gap: 15px;
}

View File

@ -348,20 +348,6 @@ function buildVideoButton(titleContainer) {
dlButton.classList.add('ta-button');
dlButton.href = '#';
Object.assign(dlButton.style, {
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
backgroundColor: '#00202f',
color: '#fff',
fontSize: '1.4rem',
textDecoration: 'none',
borderRadius: '8px',
cursor: 'pointer',
height: 'fit-content',
opacity: 0,
});
let dlIcon = document.createElement('span');
dlIcon.innerHTML = defaultIcon;
Object.assign(dlIcon.style, {
@ -394,10 +380,12 @@ function getNearestLink(element) {
function processTitle(titleContainer) {
if (titleContainer.hasListener) return;
Object.assign(titleContainer.style, {
display: 'flex',
gap: '15px',
});
titleContainer.classList.add("ta-title-container");
if (titleContainer.style.display === "-webkit-box") {
// Compatibility with DeArrow
titleContainer.style.setProperty("display", "flex", "important");
}
titleContainer.classList.add('title-container');
titleContainer.addEventListener('mouseenter', () => {