improvement/;

bugfixes
 added word libraby (~500 words)
This commit is contained in:
Ujwal
2026-02-23 00:23:37 +05:45
parent 354f7413d1
commit fe2d793b93
6 changed files with 563 additions and 9 deletions
+11
View File
@@ -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
''';
}
}