mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-14 23:47:04 +03:00
Add option to not auto-hide info button
This commit is contained in:
@@ -41,6 +41,7 @@ interface SBConfig {
|
||||
ytInfoPermissionGranted: boolean,
|
||||
askAboutUnlistedVideos: boolean,
|
||||
allowExpirements: boolean,
|
||||
autoHideInfoButton: boolean,
|
||||
|
||||
// What categories should be skipped
|
||||
categorySelections: CategorySelection[],
|
||||
@@ -180,6 +181,7 @@ const Config: SBObject = {
|
||||
ytInfoPermissionGranted: false,
|
||||
askAboutUnlistedVideos: true,
|
||||
allowExpirements: true,
|
||||
autoHideInfoButton: true,
|
||||
|
||||
categorySelections: [{
|
||||
name: "sponsor",
|
||||
|
||||
@@ -1186,7 +1186,8 @@ async function createButtons(): Promise<void> {
|
||||
createButton("info", "openPopup", openInfoMenu, "PlayerInfoIconSponsorBlocker.svg");
|
||||
|
||||
const controlsContainer = getControls();
|
||||
if (!onInvidious && controlsContainer && playerButtons["info"]?.button && !controlsWithEventListeners.includes(controlsContainer)) {
|
||||
if (Config.config.autoHideInfoButton && !onInvidious && controlsContainer
|
||||
&& playerButtons["info"]?.button && !controlsWithEventListeners.includes(controlsContainer)) {
|
||||
controlsWithEventListeners.push(controlsContainer);
|
||||
playerButtons["info"].button.classList.add("hidden");
|
||||
|
||||
|
||||
@@ -32,7 +32,8 @@ async function init() {
|
||||
|
||||
for (let i = 0; i < optionsElements.length; i++) {
|
||||
if ((optionsElements[i].getAttribute("private-mode-only") === "true" && !(await isIncognitoAllowed()))
|
||||
|| (optionsElements[i].getAttribute("no-safari") === "true" && navigator.vendor === "Apple Computer, Inc.")) {
|
||||
|| (optionsElements[i].getAttribute("no-safari") === "true" && navigator.vendor === "Apple Computer, Inc.")
|
||||
|| (optionsElements[i].getAttribute("if-false") && Config.config[optionsElements[i].getAttribute("if-false")])) {
|
||||
optionsElements[i].classList.add("hidden");
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user