summaryrefslogtreecommitdiff
blob: 3999dc0f7fc424c656d54cf8ae962ed67edb821d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
diff --git a/ide/core.browser.webview/src/org/netbeans/core/browser/webview/ext/WebKitDebuggingTransport.java b/ide/core.browser.webview/src/org/netbeans/core/browser/webview/ext/WebKitDebuggingTransport.java
index d0b5f485e1..512700ddd0 100644
--- a/ide/core.browser.webview/src/org/netbeans/core/browser/webview/ext/WebKitDebuggingTransport.java
+++ b/ide/core.browser.webview/src/org/netbeans/core/browser/webview/ext/WebKitDebuggingTransport.java
@@ -19,6 +19,7 @@
 package org.netbeans.core.browser.webview.ext;
 
 import com.sun.javafx.scene.web.Debugger;
+import java.lang.reflect.Field;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.logging.Level;
@@ -54,7 +55,23 @@ public class WebKitDebuggingTransport implements TransportImplementationWithURLT
     @Override
     @SuppressWarnings("deprecation")
     public boolean attach() {
-        this.debugger = browserImpl.getEngine().impl_getDebugger();
+        Class webEngineClass = browserImpl.getClass();
+        Field debuggerField;
+
+        try {
+            debuggerField = webEngineClass.getDeclaredField("debugger");
+        } catch (Throwable t) {
+            throw new RuntimeException("cannot retrieve debugger field");
+        }
+
+        debuggerField.setAccessible(true);
+
+        try {
+            this.debugger = (Debugger) debuggerField.get(browserImpl.getEngine());
+        } catch (Throwable t) {
+            throw new RuntimeException("cannot retrieve debugger");
+        }
+
         this.fxCallback = new FXCallback(callback);
         Platform.runLater(new Runnable() {
             @Override