1// Website availability switch only. This does not change backend permissions. 2export const KOMIKS_WEB = true; 3 4export function isKomiksLocalHostname(hostname) { 5 const normalized = String(hostname || '').trim().toLowerCase(); 6 return normalized === 'localhost' 7 || normalized === '127.0.0.1' 8 || normalized === '::1' 9 || normalized === '[::1]'; 10} 11 12export function isKomiksEnabled(hostname = globalThis.location?.hostname || '', releaseEnabled = KOMIKS_WEB) { 13 return releaseEnabled === true || isKomiksLocalHostname(hostname); 14} 15 16export function isKomiksHash(hash) { 17 if (typeof hash !== 'string') return false; 18 return hash === '#komiks' || hash.startsWith('#komiks/'); 19} 20 21export function komiksAvailabilityDecision(hash, hostname = globalThis.location?.hostname || '', releaseEnabled = KOMIKS_WEB) { 22 return !isKomiksEnabled(hostname, releaseEnabled) && isKomiksHash(hash) ? 'redirect-home' : 'allow'; 23} 24 25// Persistent chapter comments ship behind their own flag. Deliberately NOT 26// localEngagement: that governs the unsaved Likes/comments mock and stays false 27// permanently. Localhost previews the real feature so it can be exercised before 28// release; every other host waits for the flag. 29export function isKomiksChapterCommentsEnabled(hostname, releaseEnabled = false) { 30 return releaseEnabled === true || isKomiksLocalHostname(hostname); 31}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.