You've already forked Tricky-Addon-Update-Target-List
mirror of
https://github.com/KOWX712/Tricky-Addon-Update-Target-List.git
synced 2025-09-06 06:37:09 +00:00
request api on mmrl 33045+
This commit is contained in:
@@ -162,15 +162,23 @@ document.querySelector(".uninstall-container").addEventListener("click", async (
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Function to check if running in MMRL
|
// Function to check if running in MMRL
|
||||||
function adjustHeaderForMMRL() {
|
function checkMMRL() {
|
||||||
if (typeof ksu !== 'undefined' && ksu.mmrl) {
|
if (typeof ksu !== 'undefined' && ksu.mmrl) {
|
||||||
console.log("Running in MMRL");
|
// Adjust elements position for MMRL
|
||||||
title.style.top = 'var(--window-inset-top)';
|
title.style.top = 'var(--window-inset-top)';
|
||||||
const insetTop = getComputedStyle(document.documentElement).getPropertyValue('--window-inset-top');
|
const insetTop = getComputedStyle(document.documentElement).getPropertyValue('--window-inset-top');
|
||||||
const insetTopValue = parseInt(insetTop, 10);
|
const insetTopValue = parseInt(insetTop, 10);
|
||||||
searchMenuContainer.style.top = `${insetTopValue + 40}px`;
|
searchMenuContainer.style.top = `${insetTopValue + 40}px`;
|
||||||
headerBlock.style.display = 'block';
|
headerBlock.style.display = 'block';
|
||||||
floatingCard.style.bottom = 'calc(var(--window-inset-bottom) + 50px)';
|
floatingCard.style.bottom = 'calc(var(--window-inset-bottom) + 50px)';
|
||||||
|
|
||||||
|
// Request API permission, supported version: 33045+
|
||||||
|
try {
|
||||||
|
$tricky_store.requestAdvancedKernelSUAPI();
|
||||||
|
$tricky_store.requestFileSystemAPI();
|
||||||
|
} catch (error) {
|
||||||
|
console.log("Error requesting API:", error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -273,8 +281,8 @@ window.addEventListener('scroll', () => {
|
|||||||
|
|
||||||
// Initial load
|
// Initial load
|
||||||
document.addEventListener('DOMContentLoaded', async () => {
|
document.addEventListener('DOMContentLoaded', async () => {
|
||||||
|
checkMMRL();
|
||||||
hideFloatingBtn();
|
hideFloatingBtn();
|
||||||
adjustHeaderForMMRL();
|
|
||||||
getModuleVersion();
|
getModuleVersion();
|
||||||
await initializeAvailableLanguages();
|
await initializeAvailableLanguages();
|
||||||
const userLang = detectUserLanguage();
|
const userLang = detectUserLanguage();
|
||||||
|
|||||||
Reference in New Issue
Block a user