mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-10 21:47:06 +03:00
Hide submissions on mobile
This commit is contained in:
@@ -151,7 +151,8 @@ function messageListener(request: Message, sender: unknown, sendResponse: (respo
|
|||||||
//send the sponsor times along with if it's found
|
//send the sponsor times along with if it's found
|
||||||
sendResponse({
|
sendResponse({
|
||||||
found: sponsorDataFound,
|
found: sponsorDataFound,
|
||||||
sponsorTimes: sponsorTimes
|
sponsorTimes: sponsorTimes,
|
||||||
|
onMobileYouTube
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!request.updating && popupInitialised && document.getElementById("sponsorBlockPopupContainer") != null) {
|
if (!request.updating && popupInitialised && document.getElementById("sponsorBlockPopupContainer") != null) {
|
||||||
|
|||||||
@@ -31,9 +31,10 @@ interface IsInfoFoundMessage {
|
|||||||
|
|
||||||
export type Message = BaseMessage & (DefaultMessage | BoolValueMessage | IsInfoFoundMessage);
|
export type Message = BaseMessage & (DefaultMessage | BoolValueMessage | IsInfoFoundMessage);
|
||||||
|
|
||||||
interface IsInfoFoundMessageResponse {
|
export interface IsInfoFoundMessageResponse {
|
||||||
found: boolean;
|
found: boolean;
|
||||||
sponsorTimes: SponsorTime[];
|
sponsorTimes: SponsorTime[];
|
||||||
|
onMobileYouTube: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface GetVideoIdResponse {
|
interface GetVideoIdResponse {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import Config from "./config";
|
|||||||
|
|
||||||
import Utils from "./utils";
|
import Utils from "./utils";
|
||||||
import { SponsorTime, SponsorHideType, CategoryActionType } from "./types";
|
import { SponsorTime, SponsorHideType, CategoryActionType } from "./types";
|
||||||
import { Message, MessageResponse } from "./messageTypes";
|
import { Message, MessageResponse, IsInfoFoundMessageResponse } from "./messageTypes";
|
||||||
import { showDonationLink } from "./utils/configUtils";
|
import { showDonationLink } from "./utils/configUtils";
|
||||||
import { getCategoryActionType } from "./utils/categoryUtils";
|
import { getCategoryActionType } from "./utils/categoryUtils";
|
||||||
const utils = new Utils();
|
const utils = new Utils();
|
||||||
@@ -278,7 +278,7 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
|
|||||||
}, (tabs) => onTabs(tabs, updating));
|
}, (tabs) => onTabs(tabs, updating));
|
||||||
}
|
}
|
||||||
|
|
||||||
function infoFound(request: { found: boolean, sponsorTimes: SponsorTime[] }) {
|
function infoFound(request: IsInfoFoundMessageResponse) {
|
||||||
if (chrome.runtime.lastError) {
|
if (chrome.runtime.lastError) {
|
||||||
//This page doesn't have the injected content script, or at least not yet
|
//This page doesn't have the injected content script, or at least not yet
|
||||||
displayNoVideo();
|
displayNoVideo();
|
||||||
@@ -289,6 +289,7 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
|
|||||||
if (request != undefined) {
|
if (request != undefined) {
|
||||||
//remove loading text
|
//remove loading text
|
||||||
PageElements.mainControls.style.display = "flex";
|
PageElements.mainControls.style.display = "flex";
|
||||||
|
if (request.onMobileYouTube) PageElements.mainControls.classList.add("hidden");
|
||||||
PageElements.whitelistButton.classList.remove("hidden");
|
PageElements.whitelistButton.classList.remove("hidden");
|
||||||
PageElements.loadingIndicator.style.display = "none";
|
PageElements.loadingIndicator.style.display = "none";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user