Languages

Menu
Sites
Language
Javascript and Header Injection for Xamarin WebView or Tizen Native WebView

Hi everyone,

 

Currently I have a Xamarin Grid with Xamarin WebViews embedded. As I need to inject Javascript code and HTTP headers, I looked up the possibilities and only found PCL solutions for Android and iOS. Is there a way to solve this with a Xamarin WebView?

If not, I found the Tizen .NET WebView, in which both Javascript and HTTP headers can be injected. I am not sure if this WebView can be integrated as a child into a Xamarin Grid however, as it needs an ElmSharp.Window passed upon creation of the Tizen WebView object.

Has anybody found a solution to this or are there any suggestions?

 

Xamarin Grid: docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/layouts/grid
Xamarin WebView: docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/webview?tabs=windows
Tizen .NET WebView: docs.tizen.org/application/dotnet/guides/connectivity/webview

 

Best,
Ewald

Responses

1 Replies
Tizen .NET

Hello,
You can use Tizen.WebView.WebView using Xamarin.Forms Custom Renderer
I think you can change the header using WebView.SetUrlRequest().
To use it, you should use Tizen TFM more than tizen60 since it's been added from API6.
That means that you should select tizen platform 5.5 or higher when creating a new project with tizen app template.

<TizenApp.csproj>
<TargetFramework>tizen60</TargetFramework>

<tizen-manifest.xml>
<manifest xmlns="http://tizen.org/ns/packages" api-version="5.5"  .. >
  <ui-application appid="..."  api-version="6">

Thanks.