autokap 1.3.26 → 1.3.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.js +26 -0
- package/package.json +1 -1
package/dist/browser.js
CHANGED
|
@@ -1026,6 +1026,32 @@ export class Browser {
|
|
|
1026
1026
|
catch (err) {
|
|
1027
1027
|
console.warn('[gpu-check] WebGL query failed:', err.message);
|
|
1028
1028
|
}
|
|
1029
|
+
// Diagnostic — verify the enterprise managed policy file shipped in
|
|
1030
|
+
// cloud-runner/Dockerfile is actually loaded by Chromium. If
|
|
1031
|
+
// TranslateEnabled doesn't appear in chrome://policy, Playwright's
|
|
1032
|
+
// bundled Chromium isn't reading our policy directory (issue
|
|
1033
|
+
// microsoft/playwright#32324) and we need to fall back to a
|
|
1034
|
+
// pre-seeded user-data-dir for the translate.enabled pref.
|
|
1035
|
+
try {
|
|
1036
|
+
const policyPage = await instance.context.newPage();
|
|
1037
|
+
await policyPage.goto('chrome://policy', { timeout: 5000, waitUntil: 'load' });
|
|
1038
|
+
await policyPage.waitForTimeout(300);
|
|
1039
|
+
const policyInfo = await policyPage.evaluate(() => {
|
|
1040
|
+
const text = document.body?.innerText ?? '';
|
|
1041
|
+
const lines = text.split('\n').filter(l => l.toLowerCase().includes('translate'));
|
|
1042
|
+
return {
|
|
1043
|
+
hasTranslateEnabled: text.includes('TranslateEnabled'),
|
|
1044
|
+
translateLines: lines.slice(0, 10),
|
|
1045
|
+
// chrome://policy renders a "No policies set" message when none load
|
|
1046
|
+
noPoliciesMessage: text.includes('No policies set'),
|
|
1047
|
+
};
|
|
1048
|
+
});
|
|
1049
|
+
console.info('[policy-check] chrome://policy:', JSON.stringify(policyInfo));
|
|
1050
|
+
await policyPage.close();
|
|
1051
|
+
}
|
|
1052
|
+
catch (err) {
|
|
1053
|
+
console.warn('[policy-check] chrome://policy query failed:', err.message);
|
|
1054
|
+
}
|
|
1029
1055
|
}
|
|
1030
1056
|
return instance;
|
|
1031
1057
|
}
|