-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #456 from GoogleChromeLabs/develop
v0.5.0
- Loading branch information
Showing
263 changed files
with
14,077 additions
and
4,927 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
:: Chrome 3pcd with PS Extension | ||
|
||
:: Download PS Extension | ||
set "ps_analysis_tool_version=v0.5.0" | ||
cd /d %TEMP% | ||
if not exist %TEMP%\ps-analysis-tool-%ps_analysis_tool_version% ( | ||
mkdir %TEMP%\ps-analysis-tool-%ps_analysis_tool_version% | ||
curl -L -O -s https://github.com/GoogleChromeLabs/ps-analysis-tool/releases/download/%ps_analysis_tool_version%/extension-%ps_analysis_tool_version%.zip | ||
tar -xf extension-%ps_analysis_tool_version%.zip -C %TEMP%\ps-analysis-tool-%ps_analysis_tool_version% | ||
) | ||
|
||
set "CHROME_PATH=C:\Program Files\Google\Chrome\Application\chrome.exe" | ||
set "DATA_DIR=%TEMP%\chrome_data_dir-%RANDOM%" | ||
"%CHROME_PATH%" --disable-sync --no-default-browser-check --no-first-run --user-data-dir="%DATA_DIR%" --install-autogenerated-theme="255,51,51" --silent-debugger-extension-api --test-third-party-cookie-phaseout --enable-features="FirstPartySets,StorageAccessAPI,StorageAccessAPIForOriginExtension,PageInfoCookiesSubpage,PrivacySandboxFirstPartySetsUI" --load-extension="%TEMP%\ps-analysis-tool-%ps_analysis_tool_version%\extension" https://example.com >nul 2>&1 | ||
rmdir /s /q "%DATA_DIR%" >nul |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
:: Chrome 3pcd | ||
|
||
set "CHROME_PATH=C:\Program Files\Google\Chrome\Application\chrome.exe" | ||
set "DATA_DIR=%TEMP%\chrome_data_dir-%RANDOM%" | ||
"%CHROME_PATH%" --disable-sync --no-default-browser-check --no-first-run --user-data-dir="%DATA_DIR%" --install-autogenerated-theme="255,51,51" --silent-debugger-extension-api --test-third-party-cookie-phaseout --enable-features="FirstPartySets,StorageAccessAPI,StorageAccessAPIForOriginExtension,PageInfoCookiesSubpage,PrivacySandboxFirstPartySetsUI" https://example.com >nul 2>&1 | ||
rmdir /s /q "%DATA_DIR%" >nul |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
:: Chrome Chip | ||
|
||
set "CHROME_PATH=C:\Program Files\Google\Chrome\Application\chrome.exe" | ||
set "DATA_DIR=%TEMP%\chrome_data_dir-%RANDOM%" | ||
"%CHROME_PATH%" --disable-sync --no-default-browser-check --no-first-run --user-data-dir="%DATA_DIR%" --install-autogenerated-theme="150,220,150" --silent-debugger-extension-api --partitioned-cookies=true https://example.com >nul 2>&1 | ||
rmdir /s /q "%DATA_DIR%" >nul |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
:: Default Chrome with PS Extension | ||
|
||
:: Download PS Extension | ||
set "ps_analysis_tool_version=v0.5.0" | ||
cd /d %TEMP% | ||
if not exist %TEMP%\ps-analysis-tool-%ps_analysis_tool_version% ( | ||
mkdir %TEMP%\ps-analysis-tool-%ps_analysis_tool_version% | ||
curl -L -O -s https://github.com/GoogleChromeLabs/ps-analysis-tool/releases/download/%ps_analysis_tool_version%/extension-%ps_analysis_tool_version%.zip | ||
tar -xf extension-%ps_analysis_tool_version%.zip -C %TEMP%\ps-analysis-tool-%ps_analysis_tool_version% | ||
) | ||
|
||
set "CHROME_PATH=C:\Program Files\Google\Chrome\Application\chrome.exe" | ||
set "DATA_DIR=%TEMP%\chrome_data_dir-%RANDOM%" | ||
"%CHROME_PATH%" --disable-sync --no-default-browser-check --no-first-run --user-data-dir="%DATA_DIR%" --install-autogenerated-theme="150,220,150" --silent-debugger-extension-api --load-extension="%TEMP%\ps-analysis-tool-%ps_analysis_tool_version%\extension" https://example.com >nul 2>&1 | ||
rmdir /s /q "%DATA_DIR%" >nul |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
:: Default Chrome | ||
|
||
set "CHROME_PATH=C:\Program Files\Google\Chrome\Application\chrome.exe" | ||
set "DATA_DIR=%TEMP%\chrome_data_dir-%RANDOM%" | ||
"%CHROME_PATH%" --disable-sync --no-default-browser-check --no-first-run --user-data-dir="%DATA_DIR%" --install-autogenerated-theme="150,220,150" --silent-debugger-extension-api https://example.com >nul 2>&1 | ||
rmdir /s /q "%DATA_DIR%" >nul |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
curl -s https://raw.githubusercontent.com/GoogleChromeLabs/ps-analysis-tool/Setup-Different-Chrome-For-Demo/bin/chrome-default.bat -o chrome-default.bat | ||
curl -s https://raw.githubusercontent.com/GoogleChromeLabs/ps-analysis-tool/Setup-Different-Chrome-For-Demo/bin/chrome-3pcd.bat -o chrome-3pcd.bat | ||
curl -s https://raw.githubusercontent.com/GoogleChromeLabs/ps-analysis-tool/Setup-Different-Chrome-For-Demo/bin/chrome-default-ps.bat -o chrome-default-ps.bat | ||
curl -s https://raw.githubusercontent.com/GoogleChromeLabs/ps-analysis-tool/Setup-Different-Chrome-For-Demo/bin/chrome-3pcd-ps.bat -o chrome-3pcd-ps.bat | ||
curl -s https://raw.githubusercontent.com/GoogleChromeLabs/ps-analysis-tool/Setup-Different-Chrome-For-Demo/bin/chrome-chip.bat -o chrome-chip.bat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
#!/bin/bash | ||
|
||
# Download Extension | ||
extension_setup() { | ||
ps_analysis_tool_version=v0.5.0 | ||
extension_dir="/var/tmp" | ||
cd $extension_dir | ||
if [ ! -d $extension_dir/ps-analysis-tool-$ps_analysis_tool_version ]; then | ||
mkdir -p $extension_dir/ps-analysis-tool-$ps_analysis_tool_version | ||
curl -L -O -s https://github.com/GoogleChromeLabs/ps-analysis-tool/releases/download/$ps_analysis_tool_version/extension-$ps_analysis_tool_version.zip | ||
unzip -qo extension-$ps_analysis_tool_version.zip -d $extension_dir/ps-analysis-tool-$ps_analysis_tool_version | ||
fi | ||
cd - | ||
} | ||
|
||
# Detect OS | ||
if [[ "$(uname)" == "Darwin" ]]; then | ||
# Loads Chrome with a temporary profile that is deleted after Chrome is closed | ||
launch_chrome() { | ||
local CHROME_PATH="/Applications/Google Chrome.app" | ||
local DATA_DIR="$(mktemp -d '/tmp/chrome_data_dir.XXXXXXXXXX')" | ||
open -W -na "${CHROME_PATH}" --args \ | ||
--disable-sync \ | ||
--no-default-browser-check \ | ||
--no-first-run \ | ||
--start-maximized \ | ||
--auto-open-devtools-for-tabs \ | ||
--user-data-dir="${DATA_DIR}" \ | ||
--silent-debugger-extension-api \ | ||
"$@" https://example.com >/dev/null 2>&1 && rm -rf "${DATA_DIR}" & | ||
} | ||
elif [[ "$(uname)" == "Linux" ]]; then | ||
# Loads Chrome with a temporary profile that is deleted after Chrome is closed | ||
launch_chrome() { | ||
local CHROME="google-chrome" | ||
local DATA_DIR="$(mktemp -d '/tmp/chrome_data_dir.XXXXXXXXXX')" | ||
"${CHROME}" \ | ||
--disable-sync \ | ||
--no-default-browser-check \ | ||
--no-first-run \ | ||
--start-maximized \ | ||
--auto-open-devtools-for-tabs \ | ||
--user-data-dir="${DATA_DIR}" \ | ||
--silent-debugger-extension-api \ | ||
"$@" https://example.com >/dev/null 2>&1 && rm -rf "${DATA_DIR}" & | ||
} | ||
fi | ||
|
||
# Launch default chrome | ||
chrome-default() { | ||
launch_chrome \ | ||
--install-autogenerated-theme='255,51,51' | ||
} | ||
|
||
# Launch default chrome with 3rd Party Cookie Phaseout | ||
chrome-3pcd() { | ||
launch_chrome \ | ||
--install-autogenerated-theme='150,220,150' \ | ||
--test-third-party-cookie-phaseout \ | ||
--enable-features="FirstPartySets,StorageAccessAPI,StorageAccessAPIForOriginExtension,PageInfoCookiesSubpage,PrivacySandboxFirstPartySetsUI,TpcdMetadataGrants,TpcdSupportSettings,TpcdHeuristicsGrants:TpcdReadHeuristicsGrants/true/TpcdWritePopupCurrentInteractionHeuristicsGrants/30d/TpcdBackfillPopupHeuristicsGrants/30d/TpcdPopupHeuristicEnableForIframeInitiator/all/TpcdWriteRedirectHeuristicGrants/15m/TpcdRedirectHeuristicRequireABAFlow/true/TpcdRedirectHeuristicRequireCurrentInteraction/true" | ||
} | ||
|
||
# Launch default chrome with Privacy Sandbox extension | ||
chrome-default-ps() { | ||
extension_setup | ||
launch_chrome \ | ||
--install-autogenerated-theme='255,51,51' \ | ||
--load-extension="$extension_dir/ps-analysis-tool-$ps_analysis_tool_version/extension/" | ||
} | ||
|
||
# Launch default chrome with 3rd Party Cookie Phaseout with Privacy Sandbox extension | ||
chrome-3pcd-ps() { | ||
extension_setup | ||
launch_chrome \ | ||
--install-autogenerated-theme='150,220,150' \ | ||
--test-third-party-cookie-phaseout \ | ||
--load-extension="$extension_dir/ps-analysis-tool-$ps_analysis_tool_version/extension" \ | ||
--enable-features="FirstPartySets,StorageAccessAPI,StorageAccessAPIForOriginExtension,PageInfoCookiesSubpage,PrivacySandboxFirstPartySetsUI,TpcdMetadataGrants,TpcdSupportSettings,TpcdHeuristicsGrants:TpcdReadHeuristicsGrants/true/TpcdWritePopupCurrentInteractionHeuristicsGrants/30d/TpcdBackfillPopupHeuristicsGrants/30d/TpcdPopupHeuristicEnableForIframeInitiator/all/TpcdWriteRedirectHeuristicGrants/15m/TpcdRedirectHeuristicRequireABAFlow/true/TpcdRedirectHeuristicRequireCurrentInteraction/true" | ||
} | ||
|
||
# Launch default chrome with Partitioned Cookies | ||
chrome-chip() { | ||
launch_chrome \ | ||
--partitioned-cookies=true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
|
||
# create bin directory inside user home | ||
mkdir -p ~/bin/ | ||
|
||
# Download Chrome Launcher Script and save to ~/bin/chrome_launcher.sh | ||
curl -s https://raw.githubusercontent.com/GoogleChromeLabs/ps-analysis-tool/develop/bin/chrome_launcher.sh -o ~/bin/chrome_launcher.sh | ||
|
||
chmod 755 ~/bin/chrome_launcher.sh | ||
|
||
# Check Shell and auto source chrome_launcher.sh | ||
case $SHELL in | ||
*/zsh) | ||
grep "chrome_launcher.sh" ~/.zshrc > /dev/null | ||
if [ $? -ne 0 ]; then | ||
{ | ||
echo "if [ -f ~/bin/chrome_launcher.sh ]; then" | ||
echo -e "\tsource ~/bin/chrome_launcher.sh" | ||
echo "fi" | ||
} >> ~/.zshrc | ||
fi | ||
echo -e "Script added to ~/.zshrc, please restart your terminal session or run: \n\tsource ~/.zshrc" | ||
;; | ||
*/bash) | ||
grep "chrome_launcher.sh" ~/.bashrc > /dev/null | ||
if [ $? -ne 0 ]; then | ||
{ | ||
echo "if [ -f ~/bin/chrome_launcher.sh ]; then" | ||
echo -e "\tsource ~/bin/chrome_launcher.sh" | ||
echo "fi" | ||
} >> ~/.bashrc | ||
fi | ||
echo -e "Script added to ~/.bashrc, please restart your terminal session or run: \n\tsource ~/.bashrc" | ||
;; | ||
esac | ||
|
||
echo -e "\nNew commands that will be available in new terminal session:" | ||
echo -e "\tchrome-default : Opens a Chrome instance with default settings." | ||
echo -e "\tchrome-3pcd : Opens a Chrome instance with Third-Party Cookie Deprecation (3PCD) enabled." | ||
echo -e "\tchrome-default-ps : Opens a Chrome instance with default settings and the Privacy Sandbox extension installed." | ||
echo -e "\tchrome-3pcd-ps : Opens a Chrome instance with 3PCD enabled and the Privacy Sandbox extension installed." | ||
|
||
# Source into current terminal session as well | ||
source ~/bin/chrome_launcher.sh |
Oops, something went wrong.