mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2024-11-10 01:01:55 +01:00
Add warning if zoom to fill is installed
This commit is contained in:
parent
cee00a87c1
commit
8bcaf906fb
4 changed files with 22 additions and 2 deletions
|
@ -1 +1 @@
|
|||
Subproject commit 38776318f3fd01eac77e205efe21877af0b69463
|
||||
Subproject commit 3f2c11aa9bdb1e1def38e5edf114cd1480df1719
|
|
@ -75,6 +75,7 @@ interface SBConfig {
|
|||
allowScrollingToEdit: boolean;
|
||||
deArrowInstalled: boolean;
|
||||
showDeArrowPromotion: boolean;
|
||||
showZoomToFillError: boolean;
|
||||
|
||||
// Used to cache calculated text color info
|
||||
categoryPillColors: {
|
||||
|
@ -311,6 +312,7 @@ const syncDefaults = {
|
|||
allowScrollingToEdit: true,
|
||||
deArrowInstalled: false,
|
||||
showDeArrowPromotion: true,
|
||||
showZoomToFillError: true,
|
||||
|
||||
categoryPillColors: {},
|
||||
|
||||
|
|
|
@ -44,6 +44,7 @@ import { setupThumbnailListener } from "./utils/thumbnails";
|
|||
import * as documentScript from "../dist/js/document.js";
|
||||
import { Tooltip } from "./render/Tooltip";
|
||||
import { isDeArrowInstalled } from "./utils/crossExtension";
|
||||
import { runCompatibilityChecks } from "./utils/compatibility";
|
||||
|
||||
const utils = new Utils();
|
||||
|
||||
|
@ -87,7 +88,9 @@ utils.wait(() => Config.isReady(), 5000, 10).then(() => {
|
|||
Config.config.showDeArrowPromotion = false;
|
||||
}
|
||||
}
|
||||
}, 5000)
|
||||
}, 5000);
|
||||
|
||||
runCompatibilityChecks();
|
||||
});
|
||||
|
||||
const skipBuffer = 0.003;
|
||||
|
|
15
src/utils/compatibility.ts
Normal file
15
src/utils/compatibility.ts
Normal file
|
@ -0,0 +1,15 @@
|
|||
import Config from "../config";
|
||||
|
||||
export function runCompatibilityChecks() {
|
||||
if (Config.config.showZoomToFillError) {
|
||||
setTimeout(() => {
|
||||
const zoomToFill = document.querySelector(".zoomtofillBtn");
|
||||
|
||||
if (zoomToFill) {
|
||||
alert(chrome.i18n.getMessage("zoomToFillUnsupported"));
|
||||
}
|
||||
|
||||
Config.config.showZoomToFillError = false;
|
||||
}, 10000);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue