Commit 29f8ecbe authored by Lorenzo Martinico's avatar Lorenzo Martinico

Patch user agent with Windows Chrome

parent 6f719dbb
......@@ -99,7 +99,7 @@ context =
recipe = slapos.recipe.template:jinja2
template = {{ software_dir }}/scripts/cros_full_build.in
rendered = ${directory:run}/cros_full_build
md5sum = e11a8ed3fc100ddf591469ca8ac75d52
md5sum = 2191410a2e84d71164b9b13abdc95ef5
mode = 0700
context =
key bash_path bin:bash
......@@ -111,6 +111,7 @@ context =
key keep_cache parameters:configuration.keep_cache
key ebuilds_dir nayuos-ebuilds:location
raw scripts_dir {{ software_dir }}/scripts
raw patches_dir {{ software_dir }}/patches
raw logo_dir {{ software_dir }}/logo
# packages to be copied from our overlay into ChromiuOS' overlay
# those packages will be marked as dependency of root filesystem
......
diff --git a/login_manager/chrome_setup.cc b/login_manager/chrome_setup.cc
index cbe93f471..bd72cbb09 100644
--- a/login_manager/chrome_setup.cc
+++ b/login_manager/chrome_setup.cc
@@ -341,6 +341,9 @@ void AddSystemFlags(ChromiumCommandBuilder* builder) {
// On developer systems, set a flag to let the browser know.
if (builder->is_developer_end_user())
builder->AddArg("--system-developer-mode");
+ //Modify user agent to improve anonimity by preventing fingerprinting
+ const char* useragent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36"
+ builder->AddArg(base::StringPrintf("--user-agent=%s",useragent))
}
// Adds UI-related flags to the command line.
......@@ -152,6 +152,10 @@ increase_revision_number ${CHROMIUM_OVERLAY}/chromeos-base/openssh-server-init/
sed -i -n '/src_install/q;p' $(latest_ebuild ${CHROMIUM_OVERLAY}/chromeos-base/chromeos-sshd-init)
increase_revision_number ${CHROMIUM_OVERLAY}/chromeos-base/chromeos-sshd-init/
# modify user agent to improve anonimity by preventing fingerprinting
NEWUSERAGENT="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36"
sed -i "s!\$USERAGENTSTRING!${NEWUSERAGENT}!" {{patches}}/user-agent.patch
patch {{ cros_location }}/{{ branch }}/src/platform2/login_manager/chrome_setup.cc {{patches}}/user-agent.patch
# bashrc modifications
BASH_EBUILD_DIR="${PORTAGE_STABLE}/app-shells/bash"
......
......@@ -26,7 +26,7 @@ recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/instance.cfg
rendered = ${buildout:directory}/instance.cfg
mode = 0644
md5sum = 037a1c8c1091f07e8e5660b59223743f
md5sum = 688e5495d5a21a19f228e1820b3aeaa8
context =
key software_dir :_profile_base_location_
key instance_dir buildout:directory
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment