In this migration guide we describe what API has been removed in 7.13 and what alternatives you should use instead.


Intercepting Requests


To intercept URL requests with the standard (e.g. http, https) and custom schemes (e.g. my-app, jxb) the InterceptRequestCallback callback is used. It allows intercepting requests and override response data as if it was sent from a web server.

The following example demonstrates how to intercept requests with the jxb custom scheme:

network.set(InterceptRequestCallback.class, params -> {
    UrlRequest urlRequest = params.urlRequest();
    if (urlRequest.url().startsWith("jxb://")) {
        UrlRequestJob job = network.newUrlRequestJob(
                        .newBuilder(, HttpStatus.OK)
                        .addHttpHeader(HttpHeader.of("Content-Type", "text/plain"))
        return InterceptRequestCallback.Response.intercept(job);
    return InterceptRequestCallback.Response.proceed();




The previous approach with intercepting all requests has several security limitations and issues:

  • the intercepted custom schemes are treated as non-standard, so you cannot intercept jxb scheme and return HTML with JavaScript that accesses LocalStorage. It will lead to the access denied error;
  • not all schemes can be intercepted. For example, it is forbidden to intercept schemes such as chrome, data, or chrome-extensions. The API allows doing this which might lead to unexpected behavior or crash inside Chromium;
  • some schemes are treated as local schemes, e.g. file. They cannot be intercepted because it is not a network request.

In this version, we improved the API that allows intercepting URL requests and registering custom schemes. The new version does not have the security limitations and issues described above.

The following example demonstrates how to register the custom jxb scheme and intercept all corresponding URL requests:

EngineOptions options = EngineOptions
        .addScheme(Scheme.of("jxb"), params -> {
            UrlRequestJob job = params.newUrlRequestJob(
                            .addHttpHeader(HttpHeader.of("Content-Type", "text/plain"))
            return Response.intercept(job);
Engine engine = Engine.newInstance(options);



Removed API

There is no need to use the method due to the alternative way to register custom schemes and intercept URL requests, so it was removed.

Go Top