CefResourceHandler (@NotNull CefBrowser browser, CefFrame frame, String schemeName, CefRequest request) { if (!FILE_SCHEME_NAME.equals(schemeName)) return null; String url = request.getURL(); if (url == null) return null; url = normalizeUrl(url); // 1) check if the request has been registered Map<String, String> map = LOADHTML_REQUEST_MAP.get(browser); if (map != null) { String html = map.get(url); if (html != null) { return new JBCefLoadHtmlResourceHandler(html); } } // 2) otherwise allow default handling (with default CEF security) return null; }