mirror of
https://github.com/Ujwal223/FocusGram.git
synced 2026-06-09 15:13:53 +02:00
improvement/;
bugfixes added word libraby (~500 words)
This commit is contained in:
@@ -278,6 +278,10 @@ class InjectionController {
|
||||
(function() {
|
||||
function lockReelScroll(reelContainer) {
|
||||
if (reelContainer.dataset.scrollLocked) return;
|
||||
|
||||
// If session is active, don't lock
|
||||
if (window.__focusgramSessionActive === true) return;
|
||||
|
||||
reelContainer.dataset.scrollLocked = 'true';
|
||||
|
||||
let startY = 0;
|
||||
@@ -321,6 +325,7 @@ class InjectionController {
|
||||
/// JS to disable swipe-to-next behavior inside the isolated Reel player.
|
||||
static const String disableReelSwipeJS = '''
|
||||
(function disableSwipeNavigation() {
|
||||
if (window.__focusgramSessionActive === true) return;
|
||||
let startX = 0;
|
||||
document.addEventListener('touchstart', e => { startX = e.touches[0].clientX; }, {passive: true});
|
||||
document.addEventListener('touchmove', e => {
|
||||
@@ -330,6 +335,10 @@ class InjectionController {
|
||||
})();
|
||||
''';
|
||||
|
||||
/// JS to update the session state variable in the page context.
|
||||
static String buildSessionStateJS(bool active) =>
|
||||
'window.__focusgramSessionActive = $active;';
|
||||
|
||||
// ── Public API ──────────────────────────────────────────────────────────────
|
||||
|
||||
/// Full injection JS to run on every page load.
|
||||
@@ -345,9 +354,11 @@ class InjectionController {
|
||||
if (blurExplore) css.write(_blurExploreCSS);
|
||||
|
||||
return '''
|
||||
${buildSessionStateJS(sessionActive)}
|
||||
${_buildMutationObserver(css.toString())}
|
||||
$_periodicNavRemoverJS
|
||||
$_dismissAppBannerJS
|
||||
$reelsMutationObserverJS
|
||||
''';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user