Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[DISCONTINUED] uWebKit - Chromium WebView for Unity 5

Discussion in 'Assets and Asset Store' started by uWebKit.com, Aug 1, 2013.

  1. SystemDevel

    SystemDevel

    Joined:
    Oct 5, 2013
    Posts:
    36
    Hi Josh, @uWebKit.com
    I need to "control" click links on a web. Is there any way to control if user click on a link and url change and load again the old url?

    Thanks you
     
  2. MS80

    MS80

    Joined:
    Mar 7, 2014
    Posts:
    346
    Thanks smeagols! This sounds very promising!!!

    I added "Raw Image component" to "WebTexture.cs", now I can see the loaded webpage on the rawimage inside the canvas, but it does not react to any inputs (mouse, keyboard)? How exactly you got this to work?

    Could you also show me what lines you added to UWKWebView.cs to send the touch information from touchscript, I can't get it to work! Sorry, but my scripting skill is at a low base level...

    Thanks in advance!
     
  3. AntiDanilevski

    AntiDanilevski

    Joined:
    Oct 20, 2012
    Posts:
    8
    @uWebKit.com, we got one more problem and spent a while already, but seems we can't fix it by ourself.

    If we repeatedly use method void UWKWebView.LoadURL (string url) in the same instance of UWKWebView, function void UWKWebView.SendJSMessage(string msgName, object value) will be sending more than one similar message (i.e. instead of one message, it will send from 2 to 6 or even 7 similar messages).

    In the class UWKWebView we couldn't find method that could let us reset condition of UWKWebView, so SendJSMessage would send just one message.

    Please help us to make functions UWKWebView.SendJSMessage(string msgName, object value) to send just one message instead of many, if we use it again after using UWKWebView.LoadURL (string
    url).

    We use UWK 2_20p9, Unity 5.2.

    To make it easier, we have modified scripts JavascriptExample.cs and JavascriptExample.html from demo project (scene Example5Javascript) so you can see the problem yourself. If you'll call view.SendJSMessage, then, in return, event view.JSMessageReceived will be called many times instead of one.

    Have a good day, hope to hear from you soon.
     

    Attached Files:

  4. laurent-clave

    laurent-clave

    Joined:
    Jul 18, 2011
    Posts:
    280
    Hi everyone !

    I can not play and show videos, why?

    I use WebM (with LAVFilters) for converting my video.
     
  5. SystemDevel

    SystemDevel

    Joined:
    Oct 5, 2013
    Posts:
    36
    Hi, @uWebKit.com

    It's posible to open 2 instance of a same web on InPrivate mode? i'm on Standalone Windows.

    If you open two views like Facebook or anyone you have to login, you are logged on two views...

    there is any way to login on each view separately?

    Thanks you
     
    Last edited: Feb 11, 2016
  6. UniDro

    UniDro

    Joined:
    Nov 21, 2014
    Posts:
    25
    sorry. didn't read the full thread from 2013. This might be the most common question.

    Does uWebKit2 support UnityUI2. I mean panels, images, sprites and etc. Can we use Unity UI Canvas to render web page content in 2D? Thanks.
     
  7. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,042
  8. UniDro

    UniDro

    Joined:
    Nov 21, 2014
    Posts:
    25
    N3uRo, apparently uWebKit does not support mobile platforms. So you statement does not have any practical use.
    That was a big mistake and disappointment for me. And I will have to ask for refund.
     
  9. dschwabe

    dschwabe

    Joined:
    Nov 18, 2015
    Posts:
    2
    I have been experimenting with uWebKit and

    YouTube content. I observed a couple of things.
    Simple scene with a 3D plane and the WebTexture and UWK Web View scripts attached, Current size and max size set to match the aspect ratio of the plane.
    a) the YouTube player does not support switching to full-screen mode (theater mode works though). A small popup informs about this
    b) YouTube provides a special URL format to have the player open full size within the current browser window (e.g. https://www.youtube.com/v/<video-id>).
    This also does not seem to work in uWebKit, the panel stays black.
    c) on a Mac, the YT player offers quality up to 720p, but on Windows it's fixed at 360. Still though, the quality of the texture seems to be about the same. I assume the player gets this info from the WebKit environment

    Why the different resolution support between Mac & Windows?

    It appears that a) and b) should be solvable. I assume the HTML5 YT player is requesting the default size of the canvas it is embedded in and WebKit should be able to give that answer from the width and height specified as Current Width and Height, no?

    Any chance for getting this fixed anytime soon?

    Thanks,
    Detlev
     
  10. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,042
    You don't understand. I know that it doesn't support mobile platforms. My concern is that I can't publish my project to mobile platforms with some uWebKit resources on "StreamingAssets" folder.

    I have a project where I use:

    - Windows/Mac: uWebKit
    - Android: WebView
    - iOS: UIWebView

    And when I publish to Android or iOS I can't have uWebKit resources on "StreamingAssets" folder because it adds a big size to the final apk/ipa and it doesn't make sense to have it in this builds included.
     
  11. K2mia

    K2mia

    Joined:
    Jan 25, 2016
    Posts:
    12
    Hi, uWebKit looks like what I need for my project and I am currently evaluating the demo now.

    One question I have is this:

    Right now I have a Canvas that contains the player's HUD and I want it to appear in front of
    the WebGUI. But the WebGUI appears in front and takes the entire screen. Is there an easy way to
    move the WebGUI behind the other Canvas (named CanvasHUD)?

    Thanks,K2
     
  12. fafase

    fafase

    Joined:
    Jul 3, 2012
    Posts:
    161
    Hei,

    Can it build for iOS and Android?

    We are currently using UniWebView but would like to find a replacement. I could not find anything mentioning iOS nor Android so I would assume uWebKit does not. Just want to make sure we cannot use it before discarding it.
     
  13. szymonkosok

    szymonkosok

    Joined:
    Aug 11, 2015
    Posts:
    35
    Is it me, or uWebKit2 does not support typing in form fields unicode characters like ą ę ś ć (RIGHT ALT+a, RIGHT ALT+e etc.)?
     
  14. ifisch

    ifisch

    Joined:
    Jul 15, 2012
    Posts:
    35
    Any chance on fixing the bug where the whole thing freezes up if the user highlights something?

    Seems like a pretty important one to fix. I'm using Unity 5.3.1 Windows7 64bit.
     
  15. ifisch

    ifisch

    Joined:
    Jul 15, 2012
    Posts:
    35
    By the way, the "freezing on dragging" issue seems to be a year old now. Are there plans to ever fix it?

    How can you even justify selling this program with such a serious, detrimental issue?

    https://github.com/uWebKit/uWebKit/issues/127

    This even happens to me in your own downloadable demo . So the fault isn't with my javascript or unity code. It's a fundamental problem with the program.
     
  16. cowtrix

    cowtrix

    Joined:
    Oct 23, 2012
    Posts:
    322
    Hey there. I just got a crash on Unity, when initialising a webview. Any ideas? It seemed to come from setting the alpha mask to true.

    Crash:
    Code (CSharp):
    1. 0x000007FEEE5AB588 (UWKPlugin) UnityRenderEvent
    2. 0x000007FEEE591B2C (UWKPlugin) UWK_MsgSetAlphaMask
    3. 0x00000000217AA17C (Mono JIT Code) (wrapper managed-to-native) UWKPlugin:UWK_MsgSetAlphaMask (uint,bool)
    4. 0x00000000217AA0CE (Mono JIT Code) UWKWebView:SetAlphaMask (bool)
    Edit 2:
    Ok, even removing that SetAlpha still results in a crash, although with an extremely unhelpful stack trace:

    Code (CSharp):
    1. ========== OUTPUTING STACK TRACE ==================
    2.  
    3. RtlLookupFunctionEntry returned NULL function. Aborting stack walk.
    4. ========== END OF STACKTRACE ===========
    Not only that, but the build has started crashing on startup in the editor as well as standalone. Help!

    Edit 3:
    Could it be something to do with with the following warning?
    Code (CSharp):
    1. Assets/uWebKit/Internal/UWKCore.cs(71,16): warning CS0618: `UnityEngine.GL.IssuePluginEvent(int)' is obsolete: `IssuePluginEvent(eventID) is deprecated. Use IssuePluginEvent(callback, eventID) instead.'
    Edit 4: I've attached an implementation of webkit with UGUI RawImage. Currently this constantly crashes. If you could please look into fixing these crashes, I'd really appreciate it!

    http://hurt.blob.core.windows.net/announcements/UWebkitUGUI.7z
     
    Last edited: Mar 8, 2016
  17. QuickPebble

    QuickPebble

    Joined:
    Aug 8, 2015
    Posts:
    1
    Any idea how to force the UWKWebView to show only the mobile versions of websites? Building for windows 10.

    I tried changing the user agent string to match several different mobile devices, but I think I'm missing something.
     
  18. szymonkosok

    szymonkosok

    Joined:
    Aug 11, 2015
    Posts:
    35
    Do you have access to code of website(s)? If yes, you can force mobile version there. Just set some custom user agent, and change code of website to serve only mobile, when user agent is equilevant to something you have set in Unity.

    If you don't have access to code, it's gonna be harder, because many of websites uses responsive designs. You must have actual resolution to see mobile version.
     
  19. JJJohan1

    JJJohan1

    Joined:
    Oct 13, 2013
    Posts:
    11
    For anyone willing to sacrifice the ability to click and drag on the browser in return for a crash-less experience, change the for loop in the ProcessMouse(Vector3 mousePos) method in UWKWebView.cs to be:

    To clarify, 'click and drag' referring to the dragging part, so mouse down and up still work.

    Code (CSharp):
    1.  
    2.   for (int i = 0; i < 3; i++)
    3.   {
    4.       if (Input.GetMouseButtonUp(i))
    5.       {
    6.           UWKPlugin.UWK_MsgMouseButtonDown(ID, (int)mousePos.x, (int)mousePos.y, i);
    7.           UWKPlugin.UWK_MsgMouseButtonUp(ID, (int)mousePos.x, (int)mousePos.y, i);
    8.       }
    9.   }
    10.  
     
  20. Naberius

    Naberius

    Joined:
    May 16, 2015
    Posts:
    4
    Hi, UWK

    We've come across something of an intermittent issue when rendering video through the plugin. About 1 in 20 times, the UWK process will time out (25 seconds after starting) with a log series like this:

    UWKProcess has timed out, sending kill
    UWKProcess has exited
    Direct3D11 renderer falling back to shared memory


    The other 19 times, everything works as expected.

    Is there a workaround for this that you endorse? Right now we're setting a timeout on a wrapper class, listening for feedback from the webview and regenerating if nothing's happening. Works okay, but can create an awkward 25 second pause while the plugin figures itself out...

    (alternately, is there a way to set the plugin's timeout to a way-lower value to simply reduce the wait time for re-init?)

    (For context, this is a windows platform, webm format setup with video served off of S3 using a conventional <video> tag)
     
  21. qoobit

    qoobit

    Joined:
    Aug 19, 2014
    Posts:
    51
    Hi,

    I recently came by a bug in uwebkit while testing our project.

    If you load one of the URLs from our project: http://training.toyosupport.ca/media/versado-noir/?mode=app

    The initial page has an iframe embedded youtube clip that needs to be clicked for playback.

    Once the page loads in uwebkit and you click the play button, sometimes it will play but more often than not the plugin will exit with the following:

    UWKProcess has exited
    UnityEngine.Debug:Log(Object)
    UWKPlugin:log(String, Int32) (at Assets/uWebKit/Internal/UWKPlugin.cs:30)
    UWKPlugin:UWK_Update()
    UWKCore:Update() (at Assets/uWebKit/Internal/UWKCore.cs:98)

    I have confirmed this in Unity 5.2.2 up to 5.3.4. It can be replicated by going into the uwebkit example scene 1 with the web browser and playing back the video at the URL above.

    I have tested this in the Unity Editor as well as building out to Windows executable. I’m using standalone build settings and on Windows 10.

    Please see attached video: http://screencast.com/t/OtsJ16WXKWp4

    Thanks!
     
  22. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,042
    I don't understand why the support of this product it's so bad.

    There are no answers from the developer and no package updates (remove warnings, ugui integration...).

    And the worst of it it's that there is no other package that do the same so we are stuck with these bad support.

    I have two issues on github from one month ago with no answer at all.
     
  23. thylaxene

    thylaxene

    Joined:
    Oct 10, 2005
    Posts:
    716
    Well the bad support is the thing stopping me from purchasing. Sadly.
     
  24. jmbrunskill

    jmbrunskill

    Joined:
    Nov 15, 2015
    Posts:
    1
    Has anyone found a way to link to standard web browser within uWebKit? Eg. if I want to force a link to go to the system web browser rather than display within unity.
     
  25. ZealUnity

    ZealUnity

    Joined:
    Apr 13, 2014
    Posts:
    64
    Has anyone had success with video tags? The following...

    <video width="320" height="240" controls>
    <source src="fireworks2.webm" type="video/webm">
    </video>

    ...displays the control, and it seems to be loading the video (the timeline updates to the correct video length), but no actual video is displayed.
     
  26. SystemDevel

    SystemDevel

    Joined:
    Oct 5, 2013
    Posts:
    36
    Hi, @uWebKit.com

    There is any way to clear history?

    I use same view to show 3 different webs on click some 3 buttons. And i need to clear history even you're clicked any button or on Back() you return to url on later button.

    Thansk you
     
  27. an2015

    an2015

    Joined:
    Mar 30, 2016
    Posts:
    4
    Hi, We want to open a webgl animation using your uwebkit plugin, but it seems to not support webgl. So can I get any solution to this problem.(Unity suggest) Attachment is our error message.


    Thank you.
     

    Attached Files:

  28. SystemDevel

    SystemDevel

    Joined:
    Oct 5, 2013
    Posts:
    36
    Hi, @uWebKit.com

    I'm using uWebKit to embed a YouTube video by using a url.

    There is any control of volumen on uWebKit? can i mute the uWebKit component?

    Thanks you
     
  29. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
    Hello,



    We are happy to announce the availability of uWebKit3 Beta1. uWebKit3 upgrades the web technology to Chromium and vastly improves uWebKit's performance, compatibility, and stability.

    The UWKWebView C# script API has been kept consistent where possible, though Chromium's model does impose some necessary changes. Please see the example scripts and Getting Started documentation in the zip and unity package.

    This is the first beta of uWebKit3 and we're listening closely for issues and missing API features. Please download the uWebKit3 beta from the download page: http://uwebkit.com/download/

    Once out of beta, uWebKit3 will be a free upgrade for Unity Personal users. If you use Unity Pro, please contact sales@uwebkit.com with any upgrade questions.

    Here's a look at the new multitab browser example with video, google maps, etc :)



    Cheers!
    - Josh
    http://uwebkit.com/
     
    Last edited: Apr 23, 2016
  30. bdominguezvw

    bdominguezvw

    Joined:
    Dec 4, 2013
    Posts:
    96
    I have a couple of questions:

    - Add this: https://github.com/uWebKit/uWebKit/issues/178
    - In UWKWebView you have removed:
    • LoadProgress (event)
    • JSMessageReceived (event)
    • SetUserAgent
    • Reload
    • Stop
    • SetScrollPosition
    • SetCurrentSize
    • SetAlphaMask
    • ContentWidth, ContentHeight, CurrentWidth, CurrentHeight
    Where is all this? It has less features now!!!

    And also important, we need a uGUI example that get's rid of all onGUI mess.

    Thanks!
     
  31. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
    Hello @bdominguezvw, thanks for the feedback on the uWebKit3 beta. uWebKit3 is a complete rewrite and some API is either temporarily missing or has been changed to accommodate the new Chromium backend. I'll make sure to flag the list you provided in an issue with comments regarding the API delta.

    Cheers,
    - Josh
    http://www.uwebkit.com
     
  32. bdominguezvw

    bdominguezvw

    Joined:
    Dec 4, 2013
    Posts:
    96
    Also, it would be nice if you check that you can compile a project to non Windows/Mac platforms without problems (and doesn't include unnecessary libraries).

    In my case I have a native implementation on Android/iOS of WebView so I use uWebKit only in desktop platforms.
     
  33. tolstenko

    tolstenko

    Joined:
    May 31, 2012
    Posts:
    14
    Please support iOS and Android :)
     
  34. thylaxene

    thylaxene

    Joined:
    Oct 10, 2005
    Posts:
    716
    So v3 still doesn't work with uGUI RawImage?
     
  35. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,042
    @uWebKit.com also we need a "LoadStarted" method. I know that there is a "UrlChanged" but it's not the same and also it triggers after "Progress" event (in uWebKit2, in uWebKit3 we have lost progress event) so it's a bug.

    Also "LoadStarted" and "LoadFinished" should send loaded "url" in the event.

    See Android:

    http://developer.android.com/intl/e...ent.html#onPageStarted(android.webkit.WebView, java.lang.String, android.graphics.Bitmap)

    Edit: I have filled a bug with all this:

    https://github.com/uWebKit/uWebKit/issues/1
     
    Last edited: Apr 9, 2016
  36. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
  37. magicrudi

    magicrudi

    Joined:
    Mar 4, 2016
    Posts:
    3
    Hi,

    I have recently bought the plugin and encounter an issue with a website which is working fine in a browser.
    I get the error message:
    ... ReferenceError: Can't find variable ...

    Unfortunately I am not the owner of that website. Therefore I was wondering if there is a way to ignore this error.
    Is it possible to ignore reference errors in uWebKit?

    Rudi
     
  38. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
  39. byrd61bar

    byrd61bar

    Joined:
    Apr 11, 2016
    Posts:
    7
    Hi,

    I'm using the latest uWebKit build and I'm trying to export the contents of a web page that's rendered to a WebTexture inside the UWKWebView object to a jpg image file. I keep getting an all black jpg image file instead. I noticed that a standard shader is being used to render the contents of a web page to an "Albedo" main texture. When I make a call to draw the web page contents into this main texture, when I export the jpg image it comes out black. What am I missing? The code is below. I created a Unity GameObject that has a UWKWebView object and WebTexture.

    UWKWebView webView;

    webView.DrawTexture(new Rect(0, 0, webView.ContentWidth, webView.ContentHeight), false);
    webView.WebTexture.Apply();
    var curImgData = webView.WebTexture.EncodeToJPG();


    Thanks
     
  40. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
    @byrd61bar UWKWebView.DrawTexture is used to draw the webview in the GUI system, not update the texture which is done automatically. You'll need to setup a LoadFinishedDelegate (the page will be fully loaded at this point) and then save the WebTexture.

    - Josh
    http://www.uWebKit.com
     
  41. magicrudi

    magicrudi

    Joined:
    Mar 4, 2016
    Posts:
    3
    Hi Josh,

    it is not the delegate I am looking for. I am getting an 'Error: failed to to load' message and the website is not being loaded completely then. In a browser the website can be loaded properly and I don't even see the error message being indicated. Any idea how to handle that with uWebKit?

    Thanks,
    Rudi
     
  42. kityandtom

    kityandtom

    Joined:
    Apr 13, 2016
    Posts:
    1
    I use uWebKit3_Beta1.unitypackage meet following error, Please help me.
    I am using Unity 5.3.4f1
    upload_2016-4-13_19-41-55.png
     
  43. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
  44. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
  45. byrd61bar

    byrd61bar

    Joined:
    Apr 11, 2016
    Posts:
    7
    Hi Josh,

    I implemented the delegate and I'm getting notified when the LoadFinished occurs. However the contents of the WebTexture pixel buffer are still black (all zero values), I confirmed this by examining the contents of the WebTexture Pixel values. Basically the WebTexture pixel buffer isn't being updated after being initialized in the Awake() method call. I noticed there's a "WebTexture.GetNativeTexturePtr()" call that's being made to pass a native hardware texture pointer as the view for rendering. As a result, the rendering update is occurring at the pixel buffer pointed to by this hardware texture pointer and not the pixel buffer in WebTexture.

    So it looks like I need to use the value returned from the WebTexture.GetNativeTexturePtr() to access a ID3D11Resource (I'm coding in Windows) and then lock and read the contents of that pixel buffer instead. Does that sound about right?

    Thanks
     
  46. magicrudi

    magicrudi

    Joined:
    Mar 4, 2016
    Posts:
    3
    Hi Josh,

    with the beta version the webpage is being loaded completely and I don't get any error messages anymore.
    Thanks!

    rudi
     
  47. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
    @magicrudi That's great, I am glad the issue is resolved

    @byrd61bar Here's an image of the web texture in the Texture2D selector, which can be opened by selecting the texture in the inspector. It is just a standard Texture2D and you should be able to get the pixel data. Unity flips textures in memory on Direct3D11 and Direct3D9 at least according to the VS2015 frame debugger

    D3D11Texture.png


    - Josh
    http://www.uWebKit.com
     
  48. byrd61bar

    byrd61bar

    Joined:
    Apr 11, 2016
    Posts:
    7
    Hi Josh, thanks for your quick responses.

    I'm using Direct3D11 on my win 10 64bit machine. I also get the texture2D image rendered in the inspector when I select it just like you do (although my image isn't flipped). The catch is when I access the pixel buffer of that same Texture2D image in my C# code using Texture2D.GetPixel(x,y). The r,g,b,a values are all 0 in that case. Did you check the pixel values of that Texture2D image in the C# code? That's the key. It appears that the buffer referenced by Texture2D.GetNativeTexturePtr() (which displays the content) is different from the buffer referenced by Texture2D.GetPixel(x,y) (which remains blank). The latter Texture2D.GetPixel() buffer is what the C# code can access. Do you get non-zero values when you reference the Texture2D image from C# code via Texture2D.GetPixel()?

    Note: I'm basically referring to the "WebTexture" data member when I say "Texture2D".

    Thanks
     
    Last edited: Apr 19, 2016
  49. MegaThorxr

    MegaThorxr

    Joined:
    Aug 11, 2015
    Posts:
    2
    @uWebKit.com How can i change the background to transparent?
     
  50. an2015

    an2015

    Joined:
    Mar 30, 2016
    Posts:
    4
    Hi, @uWebKit.com We use the "uWebKit3_Beta1_p1.zip" to do some WebGL implement(try in local file or server). In Editor window, we can open it. But when we build it to a .exe, mostly it may halt at loading time. Any idea how to handle that with uWebKit?

    Thanks