From 7d6373282087b3434bc6e25a82ee2074b673ac5b Mon Sep 17 00:00:00 2001
From: Bjoern Esswein <4-Bjoern@users.noreply.git.esswe.in>
Date: Sat, 11 May 2024 20:52:18 +0200
Subject: [PATCH] Launch the browser in the Start event to allow other scripts
 to change the targetURL in the previous events Awake or OnEnable

---
 Runtime/WebViewComponent.cs | 8 ++------
 package.json                | 2 +-
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/Runtime/WebViewComponent.cs b/Runtime/WebViewComponent.cs
index c6ff868..1f69d85 100644
--- a/Runtime/WebViewComponent.cs
+++ b/Runtime/WebViewComponent.cs
@@ -7,6 +7,7 @@ using Newtonsoft.Json.Serialization;
 using System;
 using System.Collections;
 using System.Collections.Generic;
+using System.IO;
 using System.Linq;
 using UnityEngine;
 using UnityEngine.Events;
@@ -66,14 +67,10 @@ namespace bessw.Unity.WebView
         // Start is called before the first frame update
         private void Start()
         {
-            Debug.LogWarning("start Webview");
+            Debug.LogWarning("start Webview Component");
             rawImage = this.gameObject.GetComponent<RawImage>();
             rectTransform = this.gameObject.GetComponent<RectTransform>();
-        }
 
-        private void OnEnable()
-        {
-            Debug.LogWarning("enable Webview");
             Browser.headless = headlessBrowser;
             browser = Browser.getInstance();
 
@@ -90,7 +87,6 @@ namespace bessw.Unity.WebView
                     rawImage.SetNativeSize();
                 }));
             }));
-
         }
 
         public IEnumerator createScreenshots ()
diff --git a/package.json b/package.json
index 5241995..a9b3da7 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "bessw.unity.webview",
-  "version": "0.0.2",
+  "version": "0.0.3",
   "description": "An interactive browser for unity running the systems browser in headless mode and rendering it to a texture instead.",
   "displayName": "WebView",
   "author": "Bj\u00f6rn E\u00dfwein",
-- 
GitLab