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. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
    Important Notice:

    We have licensed and supported a Unity WebView for the last 5 years and greatly enjoyed the interaction and use cases provided by our clients. Unfortunately, development on uWebKit3 has been discontinued.

    Please see http://www.uwebkit.com for additional information.

    If you have licensed uWebKit3 and did not receive a notification, please contact sales@uwebkit.com

    If you are using the expiring beta in a project, please contact sales@uwebkit.com to receive a non-expiring build to use until a solution can be found for your project.

    If you need access to a previous version of uWebKit or have any other questions, please contact sales@uwebkit.com referencing your product key or receipt id.

    We greatly appreciate the support of our clients and please understand that this was a very difficult decision.

    Thank you.

    - Josh Engebretson
    THUNDERBEAST GAMES LLC
     
    Last edited: Jun 3, 2016
  2. pretender

    pretender

    Joined:
    Mar 6, 2010
    Posts:
    862
    Is iOS pro needed (I have Unity Pro but only iOS basic)
     
  3. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
    Hello,

    uWebKit supports iOS Basic and iOS Pro. There is a fully featured evaluation available via the website.

    Cheers,
    Josh
    http://www.uWebKit.com
     
  4. GXMark

    GXMark

    Joined:
    Oct 13, 2012
    Posts:
    514
    Does uWebKit have any way to interact with your own custom made html pages such that Unity can respond similar to how it responds through its native GUI system?
     
  5. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
    Hello,

    On Desktop, there is a powerful Javascript bridge interface for binding events and data. An example of responding to an onclick event in Unity is available here: https://github.com/TheEngineCompany...tExamples/Scripts/WebBrowser/UnityInfoPage.cs

    On iOS, Javascript evaluation is available however due to platform limitations we really can't do callbacks and shared objects. So, this would have to be a polling architecture.

    ~Josh
     
  6. John-Wussow

    John-Wussow

    Joined:
    Aug 27, 2013
    Posts:
    3
    We recently needed to upgrade to Unity 4.2 to fix a couple of issues in our game. Now when building for iOS the auto-generated uWebKit .h files are referencing AppController.h instead of UnityAppController.h. These are easy to fix if you are doing a manual build to Xcode, but this breaks the AutoPilot feature of TestFlight which speeds up building immensely. Is this fixed in uWebKit 1.5?
     
  7. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
  8. Yann

    Yann

    Joined:
    Oct 20, 2007
    Posts:
    432
    Great to hear again from uWebKit !
     
  9. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
  10. G_Trex

    G_Trex

    Joined:
    Apr 20, 2013
    Posts:
    98
    Hi.

    I'm a little confused about how to display a local html file as opposed to an online page.

    I thought something like this would make sense, but it's giving me errors :

    Code (csharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using UWK;
    4.  
    5. public class MyWebGUI : MonoBehaviour {
    6.    
    7.     UWKView View;
    8.     // Use this for initialization
    9.     void Start () {
    10.        
    11.         //create view
    12.         View = UWKView.LoadURL ("MyView","file://pagetest1",1000,200);
    13.    
    14.     }
    15.    
    16.     // Update is called once per frame
    17.     void OnGUI () {
    18.         /// draw view
    19.         View.OnWebGUI(500,700);
    20.    
    21.     }
    22. }
    23.  
    How do I load the page?

    Also, my apologies if you're not answering these types of questions.
     
  11. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
  12. G_Trex

    G_Trex

    Joined:
    Apr 20, 2013
    Posts:
    98
    I'm afraid using the absolute path didn't help.

    Are you saying that the code seems correct however?

    If it helps, this is the error I get : An object reference is required to access non-static member `UWKView.LoadURL(string)'
     
  13. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
  14. G_Trex

    G_Trex

    Joined:
    Apr 20, 2013
    Posts:
    98
    I used the code in the link you posted and it's working now.

    Here's the code for anyone who wants to do anything similar :

    Code (csharp):
    1. using UnityEngine;
    2. using UWK;
    3.  
    4. /// <summary>
    5. /// Minimal WebGUI using uWebKit and Unity GUI
    6. /// </summary>
    7. public class MyWebGUI : MonoBehaviour
    8. {
    9.  
    10. // URL
    11. public string URL = "file:// C:/Users/Greg/Desktop/pagetest1";
    12.  
    13. // position
    14. public int X = 500;
    15. public int Y = 0;
    16.  
    17. // dimensions
    18. public int Width = 1024;
    19. public int Height = 100;
    20.  
    21. // transparency
    22. public float Transparency = 100.0f;
    23.  
    24. // the view itself
    25. public UWKView View;
    26.  
    27. void Start ()
    28. {  
    29. // Create the view
    30. View = UWKCore.CreateView ("MyView", URL, Width, Height);  
    31. }
    32.  
    33. void OnGUI ()
    34. {
    35. // Draw the view
    36. View.OnWebGUI(X, Y, Width, Height, Transparency);
    37. }
    38.  
    39. }
    Worth mentioning that with this code, altering the parameters via the inspector seems to be the best way of using it.

    I have one last remaining question however. Is there a way just loading an html file from the assets folder? I could use something like C:\Users\Greg\Documents\ATD\Assets\pagetest1.html, but it would'nt work for someone playing the game on another computer (their directories would be different).
     
  15. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
  16. k_Strannik

    k_Strannik

    Joined:
    Mar 3, 2013
    Posts:
    2
    Hello,

    I'm trying to get the HTML source code of current page in UrlChanged(UWKView view, string url).
    How do I get the HTML source code of current page?
     
  17. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
    Hello you should be able to query the page with:

    view.EvaluateJavaScript("document.body.innerHTML;", evalResult);

    where evalResult would be:

    void evalResult (object sender, CommandProcessEventArgs args)
    {
    Command cmd = args.Cmd;

    string pageSource = Plugin.GetString(cmd.iParams[0], cmd.iParams[1]);

    Debug.Log(pageSource);
    }

    ~Josh
     
  18. k_Strannik

    k_Strannik

    Joined:
    Mar 3, 2013
    Posts:
    2
  19. AngryOrange

    AngryOrange

    Joined:
    Jan 30, 2012
    Posts:
    103
    Hi
    I need to display my html documents in unity app. Is it possible using this tool ?
    I want to store documents in some kind data base and render them using hmm NGUI or something similar .
     
  20. Nerg

    Nerg

    Joined:
    Jan 25, 2013
    Posts:
    2
    Hello,

    I'm trying to make a test build to an iOS device, but having the following error in XCode:

    I'm using the trial version of uWebKit (tried both the latest and the current beta) with Unity pro 3.5.7. on a Mac with XCode 4.6. Any idea what might cause this issue? It could easily be on my side since I'm not too familiar with Mac builds.
     
  21. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
    @AngryOrange: Yes, uWebKit renders HTML over the wire, from local files, or from generated strings. I would suggest getting the trial version: http://uwebkit.com/download

    @Nerg: Unity4 changes up the iOS Obj-C stuff significantly. The 1.4 package supports Unity 3.5, the newer packages support Unity 4. You can get the 1.4 package from the GitHub site: https://github.com/TheEngineCompany/uWebKit

    ~Josh
     
  22. Nerg

    Nerg

    Joined:
    Jan 25, 2013
    Posts:
    2
    Oh great, thank you!
     
  23. Iwa

    Iwa

    Joined:
    May 2, 2013
    Posts:
    4
    Hi, I've tried your trial version of uWebKit and I'm having some troubles when I've tried the code that G_Trex have posts.

    I've tried to launch the webpage and it seems to works.

    I've noticed then that a UWKView is needed in this example so I've created a UWKView and when I try to launch the game it make unity crash. Do you have any ideas about that? Is it because I'm working with a trial version?

    I don't know if everything is clear. Don't hesitate to ask. By the way your plugin is really interesting and I will maybe purchase this soon if i manage to test what i want to do :)
     
    Last edited: Sep 18, 2013
  24. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
  25. Iwa

    Iwa

    Joined:
    May 2, 2013
    Posts:
    4
    Okay thank you Josh, I think I was not clearly awake when I post this, because I didn't see the

    View = UWKCore.CreateView ("BasicWebGUI", URL, Width, Height);

    Okay so my creation of the Web view is okay.

    Now I'm facing another problem. It seems that if I choose to have a transparent background in my web page, it still a white bacground on my page in unity. So here is two questions :

    * is there a way to change the depth of my page?
    * is there a way to have a web page with a transparent background to show the 3D unity scene behind :)

    Thanks again for your help :)


    Iwa
     
    Last edited: Sep 19, 2013
  26. EvilGia

    EvilGia

    Joined:
    Jul 4, 2012
    Posts:
    4
    Hi, we have an issue with playing sound through javascript on WIndows. Is there a way to post a ticket on this?
     
  27. killliu2013

    killliu2013

    Joined:
    Apr 15, 2013
    Posts:
    1
    Can not be displayed in unity3d with. Swf page. in this page,Swf call a computer webcam
     
  28. kilosaurus

    kilosaurus

    Joined:
    Oct 2, 2013
    Posts:
    5
    Hi,

    I'm trying to use uwebkit behind a proxy, and i just can't succeed.

    I've set this :

    Code (csharp):
    1.  
    2. /// <summary>
    3.         /// enable disable proxy support
    4.         /// </summary>
    5.         public static bool ProxyEnabled = true;
    6.  
    7.         /// <summary>
    8.         /// The proxy hostname.
    9.         /// </summary>
    10.         public static string ProxyHostname = "192.168.1.102";
    11.         /// <summary>
    12.         /// The proxy port.
    13.         /// </summary>
    14.         public static int ProxyPort = 8080;
    15.  
    in the config file but it does not work :s.
     
  29. JoshEnge

    JoshEnge

    Joined:
    Oct 3, 2013
    Posts:
    2
    We have been unable to log into the Unity forums due to a database error and have a support ticket in to get it resolved. Hopefully, Unity fixes it soon but until then have to post from this account.

    @EvilGia: We use GitHub for issue tracking. https://github.com/TheEngineCompany/uWebKit

    @killliu2013: It sounds like that camera swf needs to directly access the screen. uWebKit renders to an offscreen buffer for integration with Unity content.

    @McKlane: Are there any errors in the player.log?

    ~Josh
     
  30. kilosaurus

    kilosaurus

    Joined:
    Oct 2, 2013
    Posts:
    5
    I have no errors in the player log.

    I've wiresharked the process and it shows me that uwebkit is not using the proxy. ( I've filtered the traffic with a filter on the proxy port )

    I am using uwebkit pro trial on windows with the latest stable version ( i'll buy it if i can use the proxy settings ).
     
    Last edited: Oct 4, 2013
  31. Yuuki-Mochiduki

    Yuuki-Mochiduki

    Joined:
    Nov 29, 2012
    Posts:
    11
    I purchased the UWebkit standard version.
    I occurred the limitation that is "uWebKit Pro required for WebView resolution greater than 1024".
    I cannot find this limitation before purchasing.
    So, I cannot use this plugin for my purpose although I paid...
     
  32. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
    @McKlane: There is an issue with the proxy support that is being worked on. I'll post here when the new version is available.

    @Yuuki.Mochiduki: There is a full featured evaluation version available (http://uwebkit.com/download) to ensure uWebKit meets requirements. I see that the compare chart is missing the texture size resolution information and it will get updated. Please email sales@uwebkit.com with this issue and we'll assist you.

    ~Josh
     
  33. crawler

    crawler

    Joined:
    Aug 9, 2012
    Posts:
    27
    I have a problem with rendering a WebGUI elements in a Linear Color Space. WebGUI looks so dark.
    How can I fix it? Thanks!

     
  34. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
    Hello crawler,

    What happens when you change:

    https://github.com/TheEngineCompany...b/uWebKit/Assets/uWebKit/UWKTextureSet.cs#L90

    to either:

    BackBuffer = new Texture2D ((int)Width, (int)Height, TextureFormat.ARGB32, false. false);

    or

    BackBuffer = new Texture2D ((int)Width, (int)Height, TextureFormat.ARGB32, false, true);

    If smart rectangles are being used the SubBuffer will also need to be changed on line https://github.com/TheEngineCompany.../uWebKit/Assets/uWebKit/UWKTextureSet.cs#L114

    ~Josh
     
  35. crawler

    crawler

    Joined:
    Aug 9, 2012
    Posts:
    27
    I have changed 2 lines, and it works lika a charm! Thank you so much for the great plugin!

    BackBuffer = new Texture2D ((int)Width, (int)Height, TextureFormat.ARGB32, false, true);
     
  36. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
    Hello,

    Updated uWebKit 1.5 binary packages are available from the GitHub site: https://github.com/uWebKit/uWebKit

    uWebKit 1.5 updates the embedded version of WebKit, features greatly enhanced web proxy server support, support for HTML5 local storage, and a number of performance improvement and fixes.

    Please report any issues with the new package here.

    Cheers,
    ~Josh
    http://www.uwebkit.com
     
  37. Yeahpoint

    Yeahpoint

    Joined:
    Oct 8, 2013
    Posts:
    3
    I just download the and activate my trail version on my mac and all the exaples work, but when I change the build settings to Windows, there is this notification: "uWebKit process missing, have you injected the player?" I clicked on the suggested button uWebKit > Inject Player which opens up a finder window, where of what is this player I need to inject. I'm building this project on my Mac becasue I have a Unity Pro on here, but the compiles files will run on windows...
    Any help would be great
     
  38. uWebKit.com

    uWebKit.com

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

    koalaaaaa

    Joined:
    Oct 22, 2013
    Posts:
    3
    Hello,
    I just download uwebkit, when I visit an url, how can I pass some parameters to my page?Like the Android javascriptinterface did.
    Any help would be great!
    PS: do you have an uwebkit api or something like that?
     
    Last edited: Oct 22, 2013
  40. Yeahpoint

    Yeahpoint

    Joined:
    Oct 8, 2013
    Posts:
    3
    Hey Josh
    I downloaded the file. I opened up a new project within Unity and reimported the uWebkit files that you had in Git. The Mac version still works great, but as soon as I set the player settings to windows, it asks me to inject a player, same issue as before.
    Thanks for taking the time to look into this, we've sortof made promises to a client that we're relying on this for.

    Regards
    JC



     
  41. Yeahpoint

    Yeahpoint

    Joined:
    Oct 8, 2013
    Posts:
    3
    Hey Josh
    I downloaded the file. I opened up a new project within Unity and reimported the uWebkit files that you had in Git. The Mac version still works great, but as soon as I set the player settings to windows, it asks me to inject a player, same issue as before.
    Thanks for taking the time to look into this, we've sortof made promises to a client that we're relying on this for.

    Regards
    JC



     
  42. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
    @Yeahpoint: The PostprocessBuildPlayer script was updated and tested for doing a Windows build from OSX. If you have the Windows build set and attempt to run in the Editor on OSX, you will get this message as uWebKit thinks it is running on Windows. I have created a separate ticket for fixing this issue: https://github.com/uWebKit/uWebKit/issues/12 (However hopefully it is not a blocker)

    ~Josh
    http://www.uWebKit.com
     
    Last edited: Oct 22, 2013
  43. koalaaaaa

    koalaaaaa

    Joined:
    Oct 22, 2013
    Posts:
    3
    Hey Josh,
    Right now I need to make new urls load in my webview. But on certain urls I just want to close the webview.
    How can I monitor those specified URL?
     
  44. uWebKit.com

    uWebKit.com

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

    koalaaaaa

    Joined:
    Oct 22, 2013
    Posts:
    3
    Now my javascript is "window.location.href='gcsdk://to_app'",I want to close my app by load this url.
    But in this way the URL changed delegate seems did not work at all.Can you give me some advice?
    Thankes
     
  46. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
    Hello,

    You can invoke Unity scripts directly from your web page with the Javascript bridge. Here's an example:

    The callback in C#, here is where you would quit the Unity application:

    https://github.com/uWebKit/uWebKit/...mples/Scripts/WebBrowser/UnityInfoPage.cs#L84

    This is how you bind the method so it is available to Javascript:

    https://github.com/uWebKit/uWebKit/...ples/Scripts/WebBrowser/UnityInfoPage.cs#L107

    You can then invoke it (with arguments) via the Unity javascript object on the page:

    https://github.com/uWebKit/uWebKit/...mples/Scripts/WebBrowser/UnityInfoPage.cs#L52

    Hope this helps,
    ~Josh
    http://www.uWebKit.com
     
  47. RedVonix

    RedVonix

    Joined:
    Dec 13, 2011
    Posts:
    421
    I'm seeing an error when attempting to build to iOS through Xcode. The error reads:

    ..../iOSBuild/Libraries/UWKWebEngine.h:7:9: 'UnityAppController.h' file not found

    When I check, I can see that UnityAppController.h does not exist - however AppController.h does exist. This makes me feel I may be using the wrong version of UWK... here are my current stats:

    Unity 4.1.5f1
    uWebKit 1.5b

    Is there anything special I need to do to make this work right, or is there possibly a different version of UWK I should be using?

    Thanks!
     
  48. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
    Hello,

    Unity updated their iOS sources for the XCode build between 4.1 and 4.2, I would suggest updating to Unity 4.2 if possible. If you need to build against Unity 4.1 try the uWebKit 1.4 package which is available from the GitHub site: https://github.com/uWebKit/uWebKit

    ~Josh
    http://www.uWebKit.com
     
  49. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
  50. jwhite19

    jwhite19

    Joined:
    Nov 18, 2013
    Posts:
    1
    Hey guys, I'm really excited to try out uWebKit. I want to build a prototype utilizing uWebKit to present to my company head so that he will purchase several licenses of the Pro version for our project. Two questions:

    1) Is there documentation I can review before I start my free trial? I'm worried about finishing the prototype in 7 days, and I was thinking that reviewing the documentation could help streamline the prototype building.

    2) Is the free trial for the standard or Pro version? My prototype will require features only available in the pro version.