diff --git a/base/ohos/sys_info_utils.cc b/base/ohos/sys_info_utils.cc index 6ca1c3c82ae24703e02d22381f0a34a03b48341a..7d40a319855d69f64b42ebdb681f8a4cf06da158 100644 --- a/base/ohos/sys_info_utils.cc +++ b/base/ohos/sys_info_utils.cc @@ -53,6 +53,8 @@ class SystemProperties { std::string base_os_name() { return base_os_name_; } + std::string api_version() { return api_version_; } + #ifdef OHOS_SCROLLBAR float get_pixel_ratio() { return virtual_pixel_ratio_;} void set_pixel_ratio(float ratio) { virtual_pixel_ratio_ = ratio;} @@ -69,6 +71,7 @@ class SystemProperties { std::string os_name_; std::string os_version_; std::string base_os_name_; + std::string api_version_; #ifdef OHOS_SCROLLBAR float virtual_pixel_ratio_ = 2.0; #endif @@ -92,7 +95,10 @@ SystemProperties::SystemProperties() .GetUserAgentOSVersion()), base_os_name_(OhosAdapterHelper::GetInstance() .GetSystemPropertiesInstance() - .GetUserAgentBaseOSName()) {} + .GetUserAgentBaseOSName()), + api_version_(OhosAdapterHelper::GetInstance() + .GetSystemPropertiesInstance() + .GetDeviceInfoApiVersion()) {} } // namespace @@ -139,6 +145,10 @@ BASE_EXPORT std::string BaseOsName() { return SystemProperties::Instance()->base_os_name(); } +BASE_EXPORT std::string ApiVersion() { + return SystemProperties::Instance()->api_version(); +} + } // namespace ohos } // namespace base \ No newline at end of file diff --git a/ohos_nweb/src/cef_delegate/nweb_handler_delegate.cc b/ohos_nweb/src/cef_delegate/nweb_handler_delegate.cc index 9fa4a9269a29e4a03cea927eff636ba97468fb2f..c282b93dc70555895eea4b9300413c9eb1aab604 100644 --- a/ohos_nweb/src/cef_delegate/nweb_handler_delegate.cc +++ b/ohos_nweb/src/cef_delegate/nweb_handler_delegate.cc @@ -1459,6 +1459,8 @@ bool NWebHandlerDelegate::OnBeforeBrowse(CefRefPtr browser, return false; } + LOG(INFO) << "taoxueao NWebHandlerDelegate::OnBeforeBrowse url " << request->GetURL().ToString(); + CefRequest::HeaderMap cef_request_headers; request->GetHeaderMap(cef_request_headers); std::map request_headers;