Skip to content

Commit cea99e4

Browse files
authored
Merge pull request #27 from CodeBrig/javascript-integration
Javascript Integration
2 parents 3949291 + 8820744 commit cea99e4

21 files changed

Lines changed: 553 additions & 36 deletions

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ deploy:
2323
provider: releases
2424
api_key: $GH_TOKEN
2525
file:
26-
- /home/travis/build/CodeBrig/Journey/build/libs/journey-browser-0.3.3.jar
27-
- /home/travis/build/CodeBrig/Journey/jcef/binary_distrib/jcef-distrib-linux64.zip
28-
- /Users/travis/build/CodeBrig/Journey/jcef/binary_distrib/jcef-distrib-macintosh64.zip
26+
- "$TRAVIS_BUILD_DIR/build/libs/journey-browser-0.4.0.jar"
27+
- "$TRAVIS_BUILD_DIR/jcef/binary_distrib/jcef-distrib-linux64.zip"
28+
- "$TRAVIS_BUILD_DIR/jcef/binary_distrib/jcef-distrib-macintosh64.zip"
2929
skip_cleanup: true
3030
on:
3131
tags: true

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ repositories {
2626
}
2727
2828
dependencies {
29-
compile 'com.github.codebrig:journey:0.3.3-online'
29+
compile 'com.github.codebrig:journey:0.4.0-online'
3030
3131
//or use the offline version (includes native CEF files for all platforms; ~300MB)
32-
//compile 'com.github.codebrig:journey:0.3.3-offline'
32+
//compile 'com.github.codebrig:journey:0.4.0-offline'
3333
}
3434
```
3535

@@ -46,10 +46,10 @@ dependencies {
4646
<dependency>
4747
<groupId>com.github.codebrig</groupId>
4848
<artifactId>journey</artifactId>
49-
<version>0.3.3-online</version>
49+
<version>0.4.0-online</version>
5050

5151
<!-- or use the offline version (includes native CEF files for all platforms; ~300MB) -->
52-
<!-- <version>0.3.3-offline</version> -->
52+
<!-- <version>0.4.0-offline</version> -->
5353
</dependency>
5454
```
5555

@@ -92,7 +92,7 @@ public class JourneyBrowser {
9292

9393
### Linux (64bit)
9494
```sh
95-
curl -L -O https://github.com/CodeBrig/Journey/releases/download/0.3.3-75-assets/jcef-distrib-linux64.zip
95+
curl -L -O https://github.com/CodeBrig/Journey/releases/download/0.4.0-78-assets/jcef-distrib-linux64.zip
9696
unzip jcef-distrib-linux64.zip
9797

9898
export LD_LIBRARY_PATH=/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64:$(pwd)/linux64/bin/lib/linux64
@@ -101,7 +101,7 @@ java -cp "linux64/bin/*" tests.detailed.MainFrame
101101

102102
### macOS (64bit)
103103
```sh
104-
curl -L -O https://github.com/CodeBrig/Journey/releases/download/0.3.3-69-assets/jcef-distrib-macintosh64.zip
104+
curl -L -O https://github.com/CodeBrig/Journey/releases/download/0.4.0-69-assets/jcef-distrib-macintosh64.zip
105105
unzip jcef-distrib-macintosh64.zip
106106
mv ./macosx64/bin/jcef_app.app .
107107

@@ -114,7 +114,7 @@ java -cp "$JAVA_PATH:$JAVA_PATH/*" -Djava.library.path=$JAVA_PATH tests.detailed
114114
### Windows (64bit) [PowerShell]
115115
```
116116
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
117-
wget https://github.com/CodeBrig/Journey/releases/download/0.3.3-75-assets/jcef-distrib-windows64.zip -OutFile jcef-distrib-windows64.zip
117+
wget https://github.com/CodeBrig/Journey/releases/download/0.4.0-78-assets/jcef-distrib-windows64.zip -OutFile jcef-distrib-windows64.zip
118118
Expand-Archive jcef-distrib-windows64.zip .
119119
120120
java -cp "./win64/bin;./win64/bin/*" "-Djava.library.path=./win64/bin/lib/win64" tests.detailed.MainFrame
@@ -124,6 +124,7 @@ java -cp "./win64/bin;./win64/bin/*" "-Djava.library.path=./win64/bin/lib/win64"
124124

125125
| Journey Version | JCEF Version (Linux) | JCEF Version (macOS) | JCEF Version (Windows) |
126126
|---------------------|----------------------|----------------------|----------------------|
127+
| 0.4.0 (2019-11-30) | [78.2.7.237](https://bitbucket.org/chromiumembedded/java-cef/commits/1e3a9146226d3df8a7f0c9c03989d220ac26ca49) (2019-11-14) | [69.0.3497.100](https://bitbucket.org/chromiumembedded/java-cef/commits/235e3a844380b72761643324e1d9b7713cae3b63) (2018-11-01) | [78.2.7.237](https://bitbucket.org/chromiumembedded/java-cef/commits/1e3a9146226d3df8a7f0c9c03989d220ac26ca49) (2019-11-14) |
127128
| 0.3.3 (2019-07-13) | [75.0.13.220](https://bitbucket.org/chromiumembedded/java-cef/commits/13ae2d6074bc00a31888fb752dd45f9cf254725d) (2019-07-09) | [69.0.3497.100](https://bitbucket.org/chromiumembedded/java-cef/commits/235e3a844380b72761643324e1d9b7713cae3b63) (2018-11-01) | [75.0.13.220](https://bitbucket.org/chromiumembedded/java-cef/commits/13ae2d6074bc00a31888fb752dd45f9cf254725d) (2019-07-09) |
128129
| 0.2.18 (2019-06-30)<br>0.2.17 (2019-06-12) | [73.1.11.216](https://bitbucket.org/chromiumembedded/java-cef/commits/6b140efeef4e566b6a68025b1dcea9b2da6e6e57) (2019-05-21) | [69.0.3497.100](https://bitbucket.org/chromiumembedded/java-cef/commits/235e3a844380b72761643324e1d9b7713cae3b63) (2018-11-01) | [73.1.11.216](https://bitbucket.org/chromiumembedded/java-cef/commits/6b140efeef4e566b6a68025b1dcea9b2da6e6e57) (2019-05-21) |
129130
| 0.2.16 (2019-06-10) | [73.1.11.215](https://bitbucket.org/chromiumembedded/java-cef/commits/d348788e3347fa4d2a421773463f7dd62da60991) (2019-05-10) | [69.0.3497.100](https://bitbucket.org/chromiumembedded/java-cef/commits/235e3a844380b72761643324e1d9b7713cae3b63) (2018-11-01) | [73.1.11.215](https://bitbucket.org/chromiumembedded/java-cef/commits/d348788e3347fa4d2a421773463f7dd62da60991) (2019-05-10) |

build.gradle

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apply plugin: 'java'
22

3+
version '0.4.0'
34
group 'com.codebrig'
4-
version '0.3.3'
55

66
sourceCompatibility = 1.8
77
archivesBaseName = 'journey-browser'
@@ -13,13 +13,15 @@ ext {
1313
'67': '67.0.3396.62',
1414
'69': '69.0.3497.100',
1515
'73': '73.1.11.216',
16-
'75': '75.0.13.220'
16+
'75': '75.0.13.220',
17+
'78': '78.2.7.237'
1718
]
1819
jcefCommit = [
1920
'67': '1fda5d8f948670d08ef86bc4e8637b8581995ce9',
2021
'69': '235e3a844380b72761643324e1d9b7713cae3b63',
2122
'73': '6b140efeef4e566b6a68025b1dcea9b2da6e6e57',
22-
'75': '13ae2d6074bc00a31888fb752dd45f9cf254725d'
23+
'75': '13ae2d6074bc00a31888fb752dd45f9cf254725d',
24+
'78': '1e3a9146226d3df8a7f0c9c03989d220ac26ca49'
2325
]
2426
}
2527

@@ -71,7 +73,7 @@ jar {
7173
}
7274

7375
task initEnvironment {
74-
def chromiumMajorVersion = "75"
76+
def chromiumMajorVersion = "78"
7577
if (System.getenv("TRAVIS_OS_NAME") == "osx") {
7678
chromiumMajorVersion = "73"
7779
}
@@ -151,7 +153,7 @@ task patchJCEF {
151153

152154
task checkoutJCEF {
153155
doFirst {
154-
def chromiumMajorVersion = "75"
156+
def chromiumMajorVersion = "78"
155157
if (System.getenv("TRAVIS_OS_NAME") == "osx") {
156158
chromiumMajorVersion = "73"
157159
}

src/main/java/com/codebrig/journey/JourneyBrowserView.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
* Wraps CefApp/CefClient/CefBrowser and extends JComponent for ease of implementation.
2121
*
2222
* @author <a href="mailto:brandon.fergerson@codebrig.com">Brandon Fergerson</a>
23-
* @version 0.3.3
23+
* @version 0.4.0
2424
* @since 0.1.1
2525
*/
26-
@SuppressWarnings({"JavaReflectionInvocation", "WeakerAccess"})
26+
@SuppressWarnings({"WeakerAccess", "unused"})
2727
public class JourneyBrowserView extends JComponent {
2828

2929
public static final String ABOUT_BLANK = "about:blank";

src/main/java/com/codebrig/journey/JourneyLoader.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* Downloads and loads the necessary CEF files for the current OS.
2121
*
2222
* @author <a href="mailto:brandon.fergerson@codebrig.com">Brandon Fergerson</a>
23-
* @version 0.3.3
23+
* @version 0.4.0
2424
* @since 0.1.1
2525
*/
2626
@SuppressWarnings({"WeakerAccess", "unused", "JavaReflectionMemberAccess"})
@@ -32,7 +32,7 @@ public class JourneyLoader extends URLClassLoader {
3232
public static final String PROJECT_URL = BUILD.getString("project_url");
3333
public static File NATIVE_DIRECTORY = new File((System.getProperty("os.name").toLowerCase().startsWith("mac"))
3434
? "/tmp" : System.getProperty("java.io.tmpdir"),
35-
"journey-" + (System.getProperty("os.name").toLowerCase().startsWith("mac") ? "69" : "75"));
35+
"journey-" + (System.getProperty("os.name").toLowerCase().startsWith("mac") ? "69" : "78"));
3636

3737
private static JourneyLoader JOURNEY_CLASS_LOADER;
3838
private static JourneyLoaderListener JOURNEY_LOADER_LISTENER = new JourneyLoaderAdapter() {
@@ -58,7 +58,7 @@ public static void setup() throws RuntimeException {
5858
if (System.getProperty("os.name").toLowerCase().startsWith("mac")) {
5959
jcefVersion = "69.0.3497.100";
6060
} else {
61-
jcefVersion = "75.0.13.220";
61+
jcefVersion = "78.2.7.237";
6262
}
6363
JOURNEY_LOADER_LISTENER.journeyLoaderStarted(VERSION, jcefVersion);
6464
if (!NATIVE_DIRECTORY.exists()) NATIVE_DIRECTORY.mkdirs();

src/main/java/com/codebrig/journey/JourneySettings.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
* Note: This doesn't use a real proxy because CefSettings exposes configuration through fields instead of methods.
88
*
99
* @author <a href="mailto:brandon.fergerson@codebrig.com">Brandon Fergerson</a>
10-
* @version 0.3.3
10+
* @version 0.4.0
1111
* @since 0.2.0
1212
*/
13-
@SuppressWarnings("WeakerAccess")
13+
@SuppressWarnings({"WeakerAccess", "unused"})
1414
public class JourneySettings {
1515

1616
public static Class CEF_SETTINGS_CLASS = JourneyLoader.getJourneyClassLoader().loadClass("org.cef.CefSettings");
@@ -210,15 +210,12 @@ public void setIgnoreCertificateErrors(boolean ignore_certificate_errors) {
210210
// }
211211
// }
212212

213-
public static enum LogSeverity {
213+
public enum LogSeverity {
214214
LOGSEVERITY_DEFAULT,
215215
LOGSEVERITY_VERBOSE,
216216
LOGSEVERITY_INFO,
217217
LOGSEVERITY_WARNING,
218218
LOGSEVERITY_ERROR,
219219
LOGSEVERITY_DISABLE;
220-
221-
private LogSeverity() {
222-
}
223220
}
224221
}

src/main/java/com/codebrig/journey/proxy/CefAppProxy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Javadoc taken from: https://bitbucket.org/chromiumembedded/java-cef
99
*
1010
* @author <a href="mailto:brandon.fergerson@codebrig.com">Brandon Fergerson</a>
11-
* @version 0.3.3
11+
* @version 0.4.0
1212
* @since 0.2.0
1313
*/
1414
@SuppressWarnings("unused")

src/main/java/com/codebrig/journey/proxy/CefBrowserProxy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Javadoc taken from: https://bitbucket.org/chromiumembedded/java-cef
1212
*
1313
* @author <a href="mailto:brandon.fergerson@codebrig.com">Brandon Fergerson</a>
14-
* @version 0.3.3
14+
* @version 0.4.0
1515
* @since 0.2.0
1616
*/
1717
@SuppressWarnings("unused")

src/main/java/com/codebrig/journey/proxy/CefClientProxy.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.codebrig.journey.proxy;
22

3+
import com.codebrig.journey.proxy.browser.CefMessageRouterProxy;
4+
import com.codebrig.journey.proxy.handler.CefJSDialogHandlerProxy;
35
import com.codebrig.journey.proxy.handler.CefLifeSpanHandlerProxy;
46
import org.joor.Reflect;
57

@@ -11,7 +13,7 @@
1113
* Javadoc taken from: https://bitbucket.org/chromiumembedded/java-cef
1214
*
1315
* @author <a href="mailto:brandon.fergerson@codebrig.com">Brandon Fergerson</a>
14-
* @version 0.3.3
16+
* @version 0.4.0
1517
* @since 0.2.0
1618
*/
1719
@SuppressWarnings("unused")
@@ -20,6 +22,10 @@ public interface CefClientProxy extends Reflect.ProxyObject {
2022
Reflect.ProxyArgumentsConverter PROXY_ARGUMENTS_CONVERTER = (methodName, args) -> {
2123
if ("addLifeSpanHandler".equals(methodName)) {
2224
args[0] = ((Reflect.ProxyInvocationHandler) Proxy.getInvocationHandler(args[0])).getUnderlyingObject();
25+
} else if ("addJSDialogHandler".equals(methodName)) {
26+
args[0] = ((Reflect.ProxyInvocationHandler) Proxy.getInvocationHandler(args[0])).getUnderlyingObject();
27+
} else if ("addMessageRouter".equals(methodName)) {
28+
args[0] = ((Reflect.ProxyInvocationHandler) Proxy.getInvocationHandler(args[0])).getUnderlyingObject();
2329
}
2430
};
2531

@@ -28,6 +34,8 @@ public interface CefClientProxy extends Reflect.ProxyObject {
2834
return Reflect.on(returnValue).as(CefBrowserProxy.class);
2935
} else if ("addLifeSpanHandler".equals(methodName)) {
3036
return Reflect.on(returnValue).as(CefClientProxy.class);
37+
} else if ("addJSDialogHandler".equals(methodName)) {
38+
return Reflect.on(returnValue).as(CefClientProxy.class);
3139
}
3240
return returnValue;
3341
};
@@ -38,6 +46,10 @@ public interface CefClientProxy extends Reflect.ProxyObject {
3846

3947
CefClientProxy addLifeSpanHandler(CefLifeSpanHandlerProxy handler);
4048

49+
CefClientProxy addJSDialogHandler(CefJSDialogHandlerProxy handler);
50+
51+
void addMessageRouter(CefMessageRouterProxy messageRouter);
52+
4153
void removeContextMenuHandler();
4254

4355
void removeDialogHandler();

src/main/java/com/codebrig/journey/proxy/browser/CefFrameProxy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Javadoc taken from: https://bitbucket.org/chromiumembedded/java-cef
99
*
1010
* @author <a href="mailto:brandon.fergerson@codebrig.com">Brandon Fergerson</a>
11-
* @version 0.3.3
11+
* @version 0.4.0
1212
* @since 0.2.18
1313
*/
1414
@SuppressWarnings("unused")

0 commit comments

Comments
 (0)