Skip to content

Update CEF Version to 138.0.21 #193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions common/webview_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ void WebviewHandler::OnBeforeClose(CefRefPtr<CefBrowser> browser) {

bool WebviewHandler::OnBeforePopup(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
int popup_id,
const CefString& target_url,
const CefString& target_frame_name,
WindowOpenDisposition target_disposition,
Expand Down
1 change: 1 addition & 0 deletions common/webview_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public CefRenderHandler{
virtual void OnBeforeClose(CefRefPtr<CefBrowser> browser) override;
virtual bool OnBeforePopup(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
int popup_id,
const CefString& target_url,
const CefString& target_frame_name,
WindowOpenDisposition target_disposition,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/webview_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class WebviewManager extends ValueNotifier<bool> {
final controller =
WebViewController(pluginChannel, browserIndex, loading: loading);
_tempWebViews[browserIndex] = controller;
_tempInjectUserScripts[browserIndex] = injectUserScripts;
_tempInjectUserScripts[browserIndex] = injectUserScripts ?? InjectUserScripts();

return controller;
}
Expand Down
5 changes: 4 additions & 1 deletion linux/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ set(CEF_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/../third/cef")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CEF_ROOT}/cmake")
find_package(CEF REQUIRED)

find_package(PkgConfig REQUIRED)
pkg_check_modules(GTK REQUIRED gtk+-3.0)

# This value is used when generating builds using this plugin, so it must
# not be changed.
set(PLUGIN_NAME "webview_cef_plugin")
Expand Down Expand Up @@ -69,7 +72,7 @@ target_compile_definitions(${PLUGIN_NAME} PRIVATE FLUTTER_PLUGIN_IMPL)
target_include_directories(${PLUGIN_NAME} INTERFACE
"${CMAKE_CURRENT_SOURCE_DIR}/include")
target_link_libraries(${PLUGIN_NAME} PRIVATE flutter)
target_link_libraries(${PLUGIN_NAME} PRIVATE PkgConfig::GTK)
target_link_libraries(${PLUGIN_NAME} PRIVATE ${GTK_LIBRARIES})

target_include_directories(${PLUGIN_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../common")

Expand Down
10 changes: 5 additions & 5 deletions linux/target_modifier/modify_target.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ scriptdir=$(cd $(dirname $0); pwd -P)

echo "Modifying target cc files..."

bash $scriptdir/tools/import_webview_cef_header_my_application.sh "$program_path/linux/my_application.cc"
bash $scriptdir/tools/add_key_release_event_to_my_application.sh "$program_path/linux/my_application.cc"
bash $scriptdir/tools/add_key_press_event_to_my_application.sh "$program_path/linux/my_application.cc"
bash $scriptdir/tools/import_webview_cef_header_my_application.sh "$program_path/linux/runner/my_application.cc"
bash $scriptdir/tools/add_key_release_event_to_my_application.sh "$program_path/linux/runner/my_application.cc"
bash $scriptdir/tools/add_key_press_event_to_my_application.sh "$program_path/linux/runner/my_application.cc"

bash $scriptdir/tools/import_webview_cef_header_main.sh "$program_path/linux/main.cc"
bash $scriptdir/tools/add_webview_init_to_main.sh "$program_path/linux/main.cc"
bash $scriptdir/tools/import_webview_cef_header_main.sh "$program_path/linux/runner/main.cc"
bash $scriptdir/tools/add_webview_init_to_main.sh "$program_path/linux/runner/main.cc"
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,19 @@ fi
# Assign file path argument
file="$1"

# Check if the file exists
# Check if the file exists at the provided path
if [ ! -f "$file" ]; then
echo "File not found: $file"
exit 1
# If not, construct a path in the parent directory with the same filename
parent_dir_file=$(dirname "$(dirname $file)")/$(basename "$file")

# Check if the file exists at the new path
if [ -f "$parent_dir_file" ]; then
file="$parent_dir_file" # Use the new path if it exists
else
# If neither path is valid, exit
echo "File not found at '$file' or in its parent directory."
exit 1
fi
fi

# Check if the line g_signal_connect exists in the file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,19 @@ fi
# Assign file path argument
file="$1"

# Check if the file exists
# Check if the file exists at the provided path
if [ ! -f "$file" ]; then
echo "File not found: $file"
exit 1
# If not, construct a path in the parent directory with the same filename
parent_dir_file=$(dirname "$(dirname $file)")/$(basename "$file")

# Check if the file exists at the new path
if [ -f "$parent_dir_file" ]; then
file="$parent_dir_file" # Use the new path if it exists
else
# If neither path is valid, exit
echo "File not found at '$file' or in its parent directory."
exit 1
fi
fi

# Check if the line g_signal_connect exists in the file
Expand Down
15 changes: 12 additions & 3 deletions linux/target_modifier/tools/add_webview_init_to_main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,19 @@ fi
# Assign file path argument
file="$1"

# Check if the file exists
# Check if the file exists at the provided path
if [ ! -f "$file" ]; then
echo "File not found: $file"
exit 1
# If not, construct a path in the parent directory with the same filename
parent_dir_file=$(dirname "$(dirname $file)")/$(basename "$file")

# Check if the file exists at the new path
if [ -f "$parent_dir_file" ]; then
file="$parent_dir_file" # Use the new path if it exists
else
# If neither path is valid, exit
echo "File not found at '$file' or in its parent directory."
exit 1
fi
fi

# Check if the line initCEFProcesses(argc, argv); already exists in the file
Expand Down
15 changes: 12 additions & 3 deletions linux/target_modifier/tools/import_webview_cef_header_main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,19 @@ fi
# Assign file path argument
file="$1"

# Check if the file exists
# Check if the file exists at the provided path
if [ ! -f "$file" ]; then
echo "File not found: $file"
exit 1
# If not, construct a path in the parent directory with the same filename
parent_dir_file=$(dirname "$(dirname $file)")/$(basename "$file")

# Check if the file exists at the new path
if [ -f "$parent_dir_file" ]; then
file="$parent_dir_file" # Use the new path if it exists
else
# If neither path is valid, exit
echo "File not found at '$file' or in its parent directory."
exit 1
fi
fi

# Check if the line already exists in the file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,19 @@ fi
# Assign file path argument
file="$1"

# Check if the file exists
# Check if the file exists at the provided path
if [ ! -f "$file" ]; then
echo "File not found: $file"
exit 1
# If not, construct a path in the parent directory with the same filename
parent_dir_file=$(dirname "$(dirname $file)")/$(basename "$file")

# Check if the file exists at the new path
if [ -f "$parent_dir_file" ]; then
file="$parent_dir_file" # Use the new path if it exists
else
# If neither path is valid, exit
echo "File not found at '$file' or in its parent directory."
exit 1
fi
fi

# Check if the line already exists in the file
Expand Down
14 changes: 6 additions & 8 deletions third/download.cmake
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
message(WARNING "current system is Linux")
if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "aarch64")
set(cef_prebuilt_path "https://cef-builds.spotifycdn.com/cef_binary_130.1.2%2Bg48f3ef6%2Bchromium-130.0.6723.44_linuxarm64.tar.bz2")
set(cef_prebuilt_version "cef_binary_130.1.2%2Bg48f3ef6%2Bchromium-130.0.6723.44_linuxarm64.tar.bz2")
set(cef_prebuilt_path "https://cef-builds.spotifycdn.com/cef_binary_138.0.21%2Bg54811fe%2Bchromium-138.0.7204.101_linuxarm64.tar.bz2")
set(cef_prebuilt_version "cef_binary_138.0.21%2Bg54811fe%2Bchromium-138.0.7204.101_linuxarm64")
else()
set(cef_prebuilt_path "https://cef-builds.spotifycdn.com/cef_binary_130.1.2%2Bg48f3ef6%2Bchromium-130.0.6723.44_linux64.tar.bz2")
set(cef_prebuilt_version "cef_binary_130.1.2%2Bg48f3ef6%2Bchromium-130.0.6723.44_linux64.tar.bz2")
set(cef_prebuilt_path "https://cef-builds.spotifycdn.com/cef_binary_138.0.21%2Bg54811fe%2Bchromium-138.0.7204.101_linux64.tar.bz2")
set(cef_prebuilt_version "cef_binary_138.0.21%2Bg54811fe%2Bchromium-138.0.7204.101_linux64")
endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
message(WARNING "current system is Windows")
set(cef_prebuilt_path "https://github.com/hlwhl/webview_cef/releases/download/prebuilt_cef_bin_linux/webview_cef_bin_0.0.2_101.0.18+chromium-101.0.4951.67_windows64.zip")
set(cef_prebuilt_version "webview_cef_bin_0.0.2_101.0.18+chromium-101.0.4951.67_windows64")
set(cef_prebuilt_path "https://cef-builds.spotifycdn.com/cef_binary_138.0.21%2Bg54811fe%2Bchromium-138.0.7204.101_windows64.tar.bz2")
set(cef_prebuilt_version "cef_binary_138.0.21%2Bg54811fe%2Bchromium-138.0.7204.101_windows64")
# elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
# message(STATUS "current system is MacOS")
# set(cef_prebuilt_path "")
endif()
set(cef_prebuilt_version_path "https://github.com/hlwhl/webview_cef/releases/download/prebuilt_cef_bin_linux/version.txt")


function(extract_file filename extract_dir)
message(WARNING "${filename} will extract to ${extract_dir} ...")
Expand Down