How to use desktop mode in a WebView

Hi,

I wanted to ask about the desktop mode in the Kodular WebView. My application needs to load in WebView but I wanted the users to switch it off at any time.

My Blocks
image

I want the app to switch to the Desktop mode when the checkbox is checked. But when I tick the checkbox, it doesn’t do anything except reload the page and play the sound. And that sound that it plays is a TTS audio that just says “desktop mode turned on”. Please let me know if the problem is related to my audio playback thing, I can remove it.

webview (1).aia (2.3 KB)

try this

Edit changed the aia code a little bit

1 Like

It works fantastically but why did my code not work? Can you explain?

1 Like

I think In the checkbox changed code

If checkbox.checked = true

Webview1.reload should be replaced with call web view to load url = get current url

And on screen 2.backpressed it should be set webview1.desktopmode = false

And remove the code that I have canceled :point_down:

754f66209f513a545712f76571ae5c4e97f9ba5f

Mark my post as the solution If you found it useful :wink:

1 Like

I understood but I need the When. Screen2 backpressed code to go back to the last page when the back button is clicked so I will keep that. And for the other suggestions you made, I’ll try it and confirm if you’re right (I hope you are)

why not you can replace radio button with checkbox

1 Like

Ok @Yashsehgal022. But your code doesn’t work after I did this to it. After I click the radio button (I haven’t replaced it with the checkbox, yet), it doesn’t do anything.

My changes
blocks (4)

It doesn’t work properly now

Thanks!

give me 5 minute just sending another aia

1 Like

webview (2).aia (2.3 KB)
try this

1 Like

First of all, thank you very much for the code and second, can a person uncheck a radio button in anyway except backpressing the screen? Sorry if that’s a silly question

Ok give me a minute just doing that too

I didn’t ask you to do it. I was just asking if that is possible. I wanted to to do it by myself

oh i made the aia anyways you can see my code if you want

webview (3).aia (2.8 KB)

1 Like

and dont forget to mark my post as the solution if you found it useful

1 Like

Thank you very much!

1 Like

It works like a charm!

1 Like

This solution works for google.com but my website (It isn’t mine but I do have permission to do this), https://orchids.letseduvate.com doesn’t work with this solution. @Yashsehgal022 is this issue related to the solution?

Thanks!

this is your website ?

Yes. I don’t own it but I got the permission to develop this app for them

ok give me a minute i am checking why its not working