MCPcopy Create free account
hub / github.com/QLHazyCoder/FlowPilot / findInboxLink

Function findInboxLink

content/gmail-mail.js:183–205  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

181}
182
183function findInboxLink() {
184 const selectors = [
185 'a[href*="#inbox"]',
186 'a[aria-label*="收件箱"]',
187 'a[aria-label*="Inbox"]',
188 ];
189
190 for (const selector of selectors) {
191 const candidates = Array.from(document.querySelectorAll(selector));
192 const visible = candidates.find(isVisibleElement);
193 if (visible) return visible;
194 if (candidates[0]) return candidates[0];
195 }
196
197 return Array.from(document.querySelectorAll('a, [role="link"]')).find((element) => {
198 const text = normalizeText(
199 element.getAttribute('aria-label')
200 || element.getAttribute('title')
201 || element.textContent
202 );
203 return /收件箱|Inbox/i.test(text);
204 }) || null;
205}
206
207const GMAIL_CATEGORY_LABELS = {
208 primary: [/^primary$/i, /^inbox$/i, /^主要$/],

Callers 3

ensureInboxReadyFunction · 0.85
refreshInboxFunction · 0.85
returnToInboxFunction · 0.85

Calls 1

normalizeTextFunction · 0.70

Tested by

no test coverage detected