ATlast — you'll never need to find your favorites on another platform again. Find your favs in the ATmosphere.
atproto

fix Twitter following page URL pattern detection

Changed followingPathPattern from strict /^\/[^/]+\/following$/
to flexible /^\/?([^/]+\/)?following\/?$/ to handle:
- /username/following
- /following (if Twitter uses this)
- Optional trailing slashes

This fixes detection issue where extension wouldn't recognize
the following page and show 'ready' state.

byarielm.fyi 1f88c638 4c9bb601

verified
Changed files
+22 -2
packages
extension
src
content
+22 -2
packages/extension/src/content/index.ts
··· 30 platform: 'twitter', 31 displayName: 'Twitter/X', 32 hostPatterns: ['twitter.com', 'x.com'], 33 - followingPathPattern: /^\/[^/]+\/following$/, 34 createScraper: () => new TwitterScraper() 35 } 36 // Future platforms can be added here: ··· 152 * Notify background of current page on load 153 */ 154 (function init() { 155 const detection = detectPlatform(); 156 157 if (detection) { 158 - console.log(`[ATlast] Detected ${detection.config.displayName} ${detection.pageType} page`); 159 160 // Notify background that we're on a supported page 161 sendToBackground({ ··· 165 platform: detection.config.platform, 166 pageType: detection.pageType 167 } 168 }); 169 } 170 })();
··· 30 platform: 'twitter', 31 displayName: 'Twitter/X', 32 hostPatterns: ['twitter.com', 'x.com'], 33 + // Match /username/following or /following with optional trailing slash 34 + followingPathPattern: /^\/?([^/]+\/)?following\/?$/, 35 createScraper: () => new TwitterScraper() 36 } 37 // Future platforms can be added here: ··· 153 * Notify background of current page on load 154 */ 155 (function init() { 156 + const host = window.location.hostname; 157 + const path = window.location.pathname; 158 + 159 + console.log('[ATlast] Content script loaded'); 160 + console.log('[ATlast] Current URL:', window.location.href); 161 + console.log('[ATlast] Host:', host); 162 + console.log('[ATlast] Path:', path); 163 + 164 const detection = detectPlatform(); 165 166 if (detection) { 167 + console.log(`[ATlast] ✅ Detected ${detection.config.displayName} ${detection.pageType} page`); 168 169 // Notify background that we're on a supported page 170 sendToBackground({ ··· 174 platform: detection.config.platform, 175 pageType: detection.pageType 176 } 177 + }).then(() => { 178 + console.log('[ATlast] ✅ Notified background: ready state'); 179 + }).catch(err => { 180 + console.error('[ATlast] ❌ Failed to notify background:', err); 181 }); 182 + } else { 183 + console.log('[ATlast] ℹ️ Not on a supported page'); 184 + console.log('[ATlast] Supported patterns:', PLATFORMS.map(p => ({ 185 + platform: p.platform, 186 + hosts: p.hostPatterns, 187 + pattern: p.followingPathPattern.toString() 188 + }))); 189 } 190 })();