-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Webkit is not working with Monaco editor #9769
Comments
I am able to (partially) reproduce. The following page does not load for me in windows webkit. Does not crash though, just hangs forever. const { chromium, webkit } = require('@playwright/test');
(async () => {
const browser = await webkit.launch({
headless: false,
// devtools: true,
// viewport: null
});
const page = await browser.newPage();
await page.setContent(`
<html>
<head>
<title>browser-amd-editor</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<h2>Monaco Editor Sample</h2>
<div id="container" style="width: 800px; height: 600px; border: 1px solid grey"></div>
<!-- OR ANY OTHER AMD LOADER HERE INSTEAD OF loader.js -->
<script src="https://unpkg.com/monaco-editor@latest/min/vs/loader.js"></script>
<script>
require.config({ paths: { vs: 'https://unpkg.com/monaco-editor@latest/min/vs' } });
require(['vs/editor/editor.main'], function () {
var editor = monaco.editor.create(document.getElementById('container'), {
value: ['function x() {', '\\tconsole.log("Hello world!");', '}'].join('\\n'),
language: 'javascript'
});
});
</script>
</body>
</html>
`, { timeout: 0 });
console.log('DONE LOADING');
})(); |
There is a very large layer 1000000x1000000. |
WinCairo's Accelerated Composting isn't mature yet. |
For the record, wetried disabling accelerated mode on windows and had to reenable it back as it broke too many sites. |
That's the reason why I recommend to use WKPreferencesSetAcceleratedCompositingEnabled API. |
@fujii do you have any instructions on how to use the API? or any sample code? |
WebKit MiniBrowser is the sample code. You need to change Playwright embedder. |
Do I need to build a custom Webkit browser with that change? If so, I am not sure how it will work for our pipelines. Can you expose it as a browser setting? |
Yes.
I'll try adding a command line flag that would allow to disable accelerated compositing when launching the browser (will call WKPreferencesSetAcceleratedCompositingEnabled internally). |
@kjcho-msft the browser patch has landed and should be available in @next version of playwright, you can pass the new flag to disable accelearated compositing in webkit on windows like below. The example above worked with the flag just fine. const browser = await playwright.webkit.launch({
args: ['--disable-accelerated-compositing']
}); |
@yury-s It looks like the fix will be in v1.17. Do you have any ETA when it will be released? |
Context:
Code Snippet
You can try some samples from https://github.com/microsoft/monaco-editor-samples
or use this:
<title>browser-amd-editor</title>Monaco Editor Sample
Describe the bug
Webkit would freeze when trying to load/initialize a Monaco editor instance.
And eventually you would see this error below:
WebKitWebProcess.exe
[Main Instruction]
WebKitWebProcess.exe has stopped working
[Content]
A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available.
The text was updated successfully, but these errors were encountered: