TLabAltoh / TLabWebViewVR

Sample Unity project for using TLabWebView in OculusQuest. Includes Meta XR SDK and XR Interaction Toolkit implementation example.
https://tlabgames.gitbook.io/tlabwebview/
MIT License
43 stars 9 forks source link

how to change view from mobile to desktop. #8

Closed StefanCiobanu1989 closed 1 year ago

StefanCiobanu1989 commented 1 year ago

Hi again, The websites are always displayed in their mobile form, is there a way to change that ? It tried changing TLabWebView and WebView width and height related properties to 1920x1080 and it still shows as the mobile website. Thanks!

TLabAltoh commented 1 year ago

Hi Stefan, A sample of displaying WebView in desktop form has been added to the repository. This sample changes the user agent of WebView to change the page display to desktop.

output

// WebViewSample.cs
public void SetUserAgent(string ua)
{
    // Change user agent (Switches the browser display to the desktop form).
    // WebView.SetUserAgent(string ua)
    m_webView.SetUserAgent("Mozilla/5.0 (X11; Linux i686; rv:10.0) Gecko/20100101 Firefox/10.0");
}

SetUserAgent(string ua) is a new feature added in this update, so clone the latest version of the repository when checking the operation.

See also User agent settings. mozilla user-agent

StefanCiobanu1989 commented 1 year ago

God like! Thank you!