Run
function main() {
"use effects";
try {
analyzePage(); // observe, _not_ async!
} handle "get_page_size" with (evt) {
getPageSize(evt.payload.url).then((size) => {
recall size;
});
}
}
function analyzePage() {
const start = Date.now();
const url = window.location.href;
const size = perform { type: "get_page_size", payload: { url } };
const { path: analysisPath } = perform {
type: "flush_analysis",
payload: { url, size },
};
const finish = Date.now();
console.info(
`{ duration: '${finish - start}ms', size: '${(size / 1000).toFixed(
2
)}kb', url: '${url}' } written to: ${analysisPath}`
);
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX