mirror of
https://github.com/primedigitaltech/azon_seeker.git
synced 2026-10-05 15:22:59 +08:00
17 lines
758 B
JavaScript
17 lines
758 B
JavaScript
import { readFile } from 'node:fs/promises';
|
|
|
|
const background = await readFile('extension/dist/background/index.mjs', 'utf8');
|
|
const contentScript = await readFile('extension/dist/contentScripts/index.global.js', 'utf8');
|
|
|
|
if (!background.includes('lastError')) {
|
|
throw new Error('Background bundle does not consume runtime.lastError on port disconnect.');
|
|
}
|
|
if (!contentScript.includes('back/forward cache')) {
|
|
throw new Error('Content script bundle does not recognize BFCache port closures.');
|
|
}
|
|
if (!contentScript.includes('pagehide') || !contentScript.includes('pageshow')) {
|
|
throw new Error('Content script bundle does not suspend and resume the BFCache port lifecycle.');
|
|
}
|
|
|
|
console.log('Production BFCache port handling verification passed.');
|