mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-11 22:17:21 +03:00
Remove submitting on mobile
This commit is contained in:
@@ -1026,18 +1026,10 @@ function createButton(baseID, title, callback, imageName, isDraggable=false): bo
|
|||||||
newButton.draggable = isDraggable;
|
newButton.draggable = isDraggable;
|
||||||
newButton.id = baseID + "Button";
|
newButton.id = baseID + "Button";
|
||||||
newButton.classList.add("playerButton");
|
newButton.classList.add("playerButton");
|
||||||
if (!onMobileYouTube) {
|
|
||||||
newButton.classList.add("ytp-button");
|
newButton.classList.add("ytp-button");
|
||||||
} else {
|
|
||||||
newButton.classList.add("icon-button");
|
|
||||||
newButton.style.padding = "0";
|
|
||||||
}
|
|
||||||
newButton.setAttribute("title", chrome.i18n.getMessage(title));
|
newButton.setAttribute("title", chrome.i18n.getMessage(title));
|
||||||
newButton.addEventListener("click", (event: Event) => {
|
newButton.addEventListener("click", (event: Event) => {
|
||||||
callback();
|
callback();
|
||||||
|
|
||||||
// Prevents the contols from closing when clicked
|
|
||||||
if (onMobileYouTube) event.stopPropagation();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Image HTML
|
// Image HTML
|
||||||
@@ -1079,6 +1071,8 @@ function getControls(): HTMLElement | boolean {
|
|||||||
|
|
||||||
//adds all the player controls buttons
|
//adds all the player controls buttons
|
||||||
async function createButtons(): Promise<boolean> {
|
async function createButtons(): Promise<boolean> {
|
||||||
|
if (onMobileYouTube) return;
|
||||||
|
|
||||||
let result = await utils.wait(getControls).catch();
|
let result = await utils.wait(getControls).catch();
|
||||||
|
|
||||||
//set global controls variable
|
//set global controls variable
|
||||||
|
|||||||
Reference in New Issue
Block a user