Skip to content
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

Device Emulation Missing in WebView2 Dev Tools #134

Open
cartmouse opened this issue Feb 20, 2023 · 8 comments
Open

Device Emulation Missing in WebView2 Dev Tools #134

cartmouse opened this issue Feb 20, 2023 · 8 comments
Labels
feature New feature or request tracked This issue is now tracked on our internal backlog

Comments

@cartmouse
Copy link

cartmouse commented Feb 20, 2023

I'm using Tauri to develop an application that will be run in a few fixed resolutions and the device emulation tool is extremely helpful in the development process to quickly test these resolutions (and also when developing more generic responsive applications).

Tauri uses WebView2 to render the web app and when using the dev tools on Windows, the "device emulation" option is missing. Without access to this feature, testing in various layouts and resolutions is quite arduous.

Is there any scope for adding this functionality or is this a hard limitation of using Edge as part of WebView2?

AB#43526862

@cartmouse cartmouse added the feature New feature or request label Feb 20, 2023
@captainbrosset
Copy link
Contributor

My understanding is that device emulation only works in the context of a true browser window. Although WebView2 uses the Edge rendering engine, it doesn't include the browser UI which, for now, is necessary to use device emulation.

I'll raise this with the team internally for discussion/prioritization. There is probably a case to be made for exposing the Dimensions drop-down that's normally inside the device emulation UI also in the main DevTools UI somewhere, therefore making it available to all scenarios, including WebView2.

@captainbrosset captainbrosset added the tracked This issue is now tracked on our internal backlog label Feb 27, 2023
@JordanBerni-UL
Copy link

Ran into this issue as well 👍 + 1 for the proposed solution

@drbsoftware
Copy link

drbsoftware commented Feb 5, 2024

We have this problem as well. It would also be useful if device emulation could be controlled through the API.

@captainbrosset
Copy link
Contributor

Thanks for commenting. This issue is still sitting on our backlog and hasn't yet been prioritized. But every message (with detailed use case explanation if possible) helps.

@drbsoftware
Copy link

drbsoftware commented Feb 5, 2024

We have two situations which use a WebBrowser in a .NET application.
• Layout Designer
• Hybrid applications

Layout Designer. All of our applications are generated by a Modeler written in .NET. The Modeler includes a Layout Designer which displays the application's layout in a WebBrowser. We are already doing some limited device emulation but having the WebBrowser do it for us would be a great help.

Hybrid Applications. We deploy some of our applications as hybrid apps, that is, a web app plus its backend code, running as a desktop app using WebBrowser. It would be very useful to test these apps using various device emulations.

@drbsoftware
Copy link

navigator.userAgent is read-only. Is there a way to set the contents in WebView2?

@captainbrosset
Copy link
Contributor

Thanks for giving details in the previous comment.

navigator.userAgent is read-only. Is there a way to set the contents in WebView2?

I don't think you can do this. But this is a question that should be asked on https://github.com/MicrosoftEdge/WebView2Feedback instead.

@s72ma18
Copy link

s72ma18 commented Sep 17, 2024

Please add the ability to simulate devices. I need it to debug mini-apps in Telegram.

It's interesting that the simulation section is present in the settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request tracked This issue is now tracked on our internal backlog
Projects
None yet
Development

No branches or pull requests

5 participants