mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2024-11-12 18:04:20 +01:00
Merge branch 'master' of https://github.com/ajayyy/SponsorBlock into chapters
This commit is contained in:
commit
3e40745621
3 changed files with 14 additions and 8 deletions
|
@ -100,6 +100,10 @@
|
|||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
#sponsorBlockPopupContainer iframe {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/*
|
||||
* Disable popup max height when displayed in-page (content.ts)
|
||||
*/
|
||||
|
@ -110,7 +114,7 @@
|
|||
/*
|
||||
* Disable fixed popup width when displayed in-page (content.ts)
|
||||
*/
|
||||
#sponsorBlockPopupContainer #sponsorBlockPopupBody {
|
||||
#sponsorBlockPopupBody.is-embedded {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
|
|
|
@ -86,6 +86,7 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
|
|||
const PageElements: PageElements = {};
|
||||
|
||||
[
|
||||
"sponsorBlockPopupBody",
|
||||
"sponsorblockPopup",
|
||||
"sponsorStart",
|
||||
// Top toggles
|
||||
|
@ -153,7 +154,7 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
|
|||
|
||||
getSegmentsFromContentScript(false);
|
||||
await utils.wait(() => Config.config !== null && allowPopup, 5000, 5);
|
||||
document.querySelector("body").style.removeProperty("visibility");
|
||||
PageElements.sponsorBlockPopupBody.style.removeProperty("visibility");
|
||||
if (!Config.configSyncListeners.includes(contentConfigUpdateListener)) {
|
||||
Config.configSyncListeners.push(contentConfigUpdateListener);
|
||||
}
|
||||
|
@ -166,6 +167,7 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
|
|||
|
||||
if (window !== window.top) {
|
||||
PageElements.sbCloseButton.classList.remove("hidden");
|
||||
PageElements.sponsorBlockPopupBody.classList.add("is-embedded");
|
||||
}
|
||||
|
||||
// Hide donate button if wanted (Safari, or user choice)
|
||||
|
|
|
@ -72,7 +72,7 @@ function getFormattedTime(seconds: number, precise?: boolean): string {
|
|||
* @returns {string} errorMessage
|
||||
*/
|
||||
function getErrorMessage(statusCode: number, responseText: string): string {
|
||||
const postFix = ((responseText && !responseText.includes(`cf-wrapper`)) ? "\n\n" + responseText : "");
|
||||
const postFix = ((responseText && !(responseText.includes(`cf-wrapper`) || responseText.includes("<!DOCTYPE html>"))) ? "\n\n" + responseText : "");
|
||||
// display response body for 4xx
|
||||
if([400, 429, 409, 0].includes(statusCode)) {
|
||||
return chrome.i18n.getMessage(statusCode + "") + " " + chrome.i18n.getMessage("errorCode") + statusCode + postFix;
|
||||
|
|
Loading…
Reference in a new issue