@@ -38,7 +38,7 @@ public class Webview implements Closeable, Runnable {
3838 @ Deprecated
3939 public long $pointer ;
4040
41- public static Component createAWT (@ NonNull Consumer <Webview > onCreate ) {
41+ public static Component createAWT (boolean debug , @ NonNull Consumer <Webview > onCreate ) {
4242 return new Canvas () {
4343 private static final long serialVersionUID = 5199512256429931156L ;
4444
@@ -63,7 +63,7 @@ public void paint(Graphics g) {
6363 this .initialized = true ;
6464
6565 new Thread (() -> {
66- this .webview = new Webview (this );
66+ this .webview = new Webview (debug , this );
6767
6868 this .updateSize ();
6969
@@ -92,27 +92,31 @@ private void updateSize() {
9292
9393 /**
9494 * Creates a new Webview.
95+ *
96+ * @param debug Enables devtools/inspect element if true.
9597 */
96- public Webview () {
97- this (NULL_PTR );
98+ public Webview (boolean debug ) {
99+ this (debug , ( PointerByReference ) null );
98100 }
99101
100102 /**
101103 * Creates a new Webview.
102104 *
105+ * @param debug Enables devtools/inspect element if true.
106+ *
103107 * @param target The target awt component, such as a {@link java.awt.JFrame} or
104108 * {@link java.awt.Canvas}
105109 */
106- public Webview (@ NonNull Component target ) {
107- this (new PointerByReference (Native .getComponentPointer (target )));
110+ public Webview (boolean debug , @ NonNull Component target ) {
111+ this (debug , new PointerByReference (Native .getComponentPointer (target )));
108112 }
109113
110114 /**
111115 * @deprecated Use this if you absolutely do know what you're doing.
112116 */
113117 @ Deprecated
114- public Webview (@ Nullable PointerByReference windowPointer ) {
115- $pointer = N .webview_create (false , windowPointer );
118+ public Webview (boolean debug , @ Nullable PointerByReference windowPointer ) {
119+ $pointer = N .webview_create (debug , windowPointer );
116120
117121 this .loadURL (null );
118122 this .setSize (800 , 600 );
0 commit comments