mirror of
https://github.com/tubearchivist/browser-extension.git
synced 2024-11-22 11:40:13 +00:00
skip empty href container link building
This commit is contained in:
parent
160580a2a6
commit
35186c09ca
@ -146,7 +146,7 @@ function ensureTALinks() {
|
|||||||
|
|
||||||
// fix positioning of #owner div to fit new button
|
// fix positioning of #owner div to fit new button
|
||||||
function adjustOwner(channelContainer) {
|
function adjustOwner(channelContainer) {
|
||||||
return channelContainer.querySelector("#buttons") || channelContainer;
|
return channelContainer.querySelector('#buttons') || channelContainer;
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildChannelButton(channelContainer) {
|
function buildChannelButton(channelContainer) {
|
||||||
@ -180,14 +180,14 @@ function buildChannelButtonDiv() {
|
|||||||
let buttonDiv = document.createElement('div');
|
let buttonDiv = document.createElement('div');
|
||||||
buttonDiv.classList.add('ta-channel-button');
|
buttonDiv.classList.add('ta-channel-button');
|
||||||
Object.assign(buttonDiv.style, {
|
Object.assign(buttonDiv.style, {
|
||||||
'display': 'flex',
|
display: 'flex',
|
||||||
'alignItems': 'center',
|
alignItems: 'center',
|
||||||
'backgroundColor': '#00202f',
|
backgroundColor: '#00202f',
|
||||||
'color': '#fff',
|
color: '#fff',
|
||||||
'fontSize': '14px',
|
fontSize: '14px',
|
||||||
'padding': '5px',
|
padding: '5px',
|
||||||
'margin-left': '8px',
|
'margin-left': '8px',
|
||||||
'borderRadius': '18px',
|
borderRadius: '18px',
|
||||||
});
|
});
|
||||||
return buttonDiv;
|
return buttonDiv;
|
||||||
}
|
}
|
||||||
@ -289,6 +289,7 @@ function getTitleContainers() {
|
|||||||
|
|
||||||
function buildVideoButton(titleContainer) {
|
function buildVideoButton(titleContainer) {
|
||||||
let href = getNearestLink(titleContainer);
|
let href = getNearestLink(titleContainer);
|
||||||
|
if (!href) return;
|
||||||
const dlButton = document.createElement('a');
|
const dlButton = document.createElement('a');
|
||||||
dlButton.classList.add('ta-button');
|
dlButton.classList.add('ta-button');
|
||||||
dlButton.href = '#';
|
dlButton.href = '#';
|
||||||
|
Loading…
Reference in New Issue
Block a user