fix: strip Electron UA tokens, refresh bookmark star on in-app navigation

- main.js: app.userAgentFallback cleaned of Electron/X.X and ESH-Media/X.X
  tokens at startup; applied to default/proxy/direct sessions. Google's
  accounts page blocked Electron UA with "Поддержка JavaScript отключена".
- Header.tsx: subscribe currentUrl to updateWebButtons (already fired on
  each in-app navigation). Bookmark star now updates as user clicks
  between movies inside the same opened site, not only on app switch.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-16 20:27:26 +03:00
parent 2857a40d1e
commit 10361cf3c0
3 changed files with 21 additions and 7 deletions

View File

@@ -21,6 +21,7 @@ const Header: React.FC<HeaderProps> = ({ activeApp, setActiveApp, onAppsChange,
const [rightDisabled, setRightDisabled] = useState(true)
const [refreshDisabled, setRefreshDisabled] = useState(true)
const [showSettings, setShowSettings] = useState(false)
const [currentUrl, setCurrentUrl] = useState<string>('')
const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null)
const activeAppRef = useRef(activeApp)
useEffect(() => { activeAppRef.current = activeApp }, [activeApp])
@@ -36,6 +37,7 @@ const Header: React.FC<HeaderProps> = ({ activeApp, setActiveApp, onAppsChange,
setLeftDisabled(app.historyPosition === 0)
setRightDisabled(app.historyPosition === app.history.length - 1)
setRefreshDisabled(false)
setCurrentUrl(app.history[app.historyPosition] || '')
})
return () => { offCloseApp(); offWebButtons() }
}, [setActiveApp])
@@ -149,12 +151,9 @@ const Header: React.FC<HeaderProps> = ({ activeApp, setActiveApp, onAppsChange,
}
useEffect(() => {
if (!appOpen) { setIsBookmarked(false); return }
window.electron?.getCurrentPage().then((page: any) => {
if (!page) return
setIsBookmarked(bookmarks.some(b => b.url === page.url))
})
}, [activeApp, bookmarks, appOpen])
if (!appOpen || !currentUrl) { setIsBookmarked(false); return }
setIsBookmarked(bookmarks.some(b => b.url === currentUrl))
}, [currentUrl, bookmarks, appOpen])
return (
<>