इन चरणों को काम की checklist की तरह इस्तेमाल करें और इन्हें परियोजना के साक्ष्य, दायरे और सीमाओं के अनुसार ढालें।
व्यावहारिक चरण
- जिस page की जाँच करनी है, उसे और browser developer console खोलें। Mobile overflow checker के लिए पहले responsive mode इस्तेमाल करें।
- Code की समीक्षा करें, पूरा snippet console में paste करें और Enter दबाएँ। यह मौजूदा page पढ़ता है; केवल sitemap metadata tool और same-origin checkers सीमित requests भेजते हैं।
- Console output या डाउनलोड की गई CSV/JSON देखें। Browser policies, authentication और unsupported server methods के कारण कुछ जाँचें निर्णायक नतीजा नहीं दे सकतीं।
(async () => {
const MAX_URLS = 200;
const CONCURRENCY = 4;
const TIMEOUT_MS = 10000;
const deadline = Date.now() + 45000;
const origin = location.origin;
const allUrls = [...new Set([...document.links].map((link) => {
try { const url = new URL(link.href); url.hash = ''; return url.origin === origin && /^https?:$/.test(url.protocol) ? url.href : ''; } catch { return ''; }
}).filter(Boolean))];
const urls = allUrls.slice(0, MAX_URLS);
const results = new Array(urls.length);
let cursor = 0;
async function worker() {
while (cursor < urls.length && Date.now() < deadline) {
const index = cursor++;
const controller = new AbortController();
const timer = setTimeout(() => controller.abort(), Math.min(TIMEOUT_MS, deadline - Date.now()));
try {
const response = await fetch(urls[index], { method: 'HEAD', credentials: 'omit', redirect: 'follow', cache: 'no-store', signal: controller.signal });
results[index] = { url: urls[index], status: response.status, finalUrl: response.url, result: response.status === 405 || response.status === 501 ? 'HEAD unsupported; check manually' : response.ok ? 'OK' : 'HTTP error' };
} catch (error) {
results[index] = { url: urls[index], status: '', finalUrl: '', result: error.name === 'AbortError' ? 'timeout' : 'blocked or network error' };
} finally { clearTimeout(timer); }
}
}
await Promise.all(Array.from({ length: Math.min(CONCURRENCY, urls.length) }, worker));
for (let index = 0; index < urls.length; index++) if (!results[index]) results[index] = { url: urls[index], status: '', finalUrl: '', result: 'not checked: 45-second runtime limit' };
console.table(results);
if (allUrls.length > MAX_URLS) console.warn('Only the first ' + MAX_URLS + ' of ' + allUrls.length + ' unique internal URLs were checked.');
console.info('Checked ' + results.filter((row) => !row.result.startsWith('not checked')).length + ' of ' + urls.length + ' unique same-origin links with HEAD requests. Limits: ' + MAX_URLS + ' links and 45 seconds. Unsupported HEAD, access restrictions, or browser policy can make a result inconclusive. No cookies were sent.');
})();चलाने से पहले review करें। यह मौजूदा page पढ़ती है; केवल sitemap और link audits सीमित same-origin requests भेजते हैं। Requests में cookies शामिल नहीं होते; script site content नहीं बदलती।