Update chrome examples
This commit is contained in:
@@ -532,12 +532,12 @@ def get_enable_do_not_track(env, config: Dict[str, str]):
|
|||||||
"import os; print(os.path.join(os.getenv('HOME'), 'Library/Application Support/Google/Chrome/Default/Preferences'))")[
|
"import os; print(os.path.join(os.getenv('HOME'), 'Library/Application Support/Google/Chrome/Default/Preferences'))")[
|
||||||
'output'].strip()
|
'output'].strip()
|
||||||
elif os_type == 'Linux':
|
elif os_type == 'Linux':
|
||||||
# preference_file_path = env.controller.execute_python_command(
|
|
||||||
# "import os; print(os.path.join(os.getenv('HOME'), '.config/google-chrome/Default/Preferences'))")[
|
|
||||||
# 'output'].strip()
|
|
||||||
preference_file_path = env.controller.execute_python_command(
|
preference_file_path = env.controller.execute_python_command(
|
||||||
"import os; print(os.path.join(os.getenv('HOME'), 'snap/chromium/common/chromium/Default/Preferences'))")[
|
"import os; print(os.path.join(os.getenv('HOME'), '.config/google-chrome/Default/Preferences'))")[
|
||||||
'output'].strip()
|
'output'].strip()
|
||||||
|
# preference_file_path = env.controller.execute_python_command(
|
||||||
|
# "import os; print(os.path.join(os.getenv('HOME'), 'snap/chromium/common/chromium/Default/Preferences'))")[
|
||||||
|
# 'output'].strip()
|
||||||
else:
|
else:
|
||||||
raise Exception('Unsupported operating system')
|
raise Exception('Unsupported operating system')
|
||||||
|
|
||||||
@@ -549,7 +549,7 @@ def get_enable_do_not_track(env, config: Dict[str, str]):
|
|||||||
return "true" if if_enable_do_not_track else "false"
|
return "true" if if_enable_do_not_track else "false"
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Error: {e}")
|
logger.error(f"Error: {e}")
|
||||||
return "Google"
|
return "false"
|
||||||
|
|
||||||
|
|
||||||
def get_enable_enhanced_safety_browsing(env, config: Dict[str, str]):
|
def get_enable_enhanced_safety_browsing(env, config: Dict[str, str]):
|
||||||
@@ -562,12 +562,12 @@ def get_enable_enhanced_safety_browsing(env, config: Dict[str, str]):
|
|||||||
"import os; print(os.path.join(os.getenv('HOME'), 'Library/Application Support/Google/Chrome/Default/Preferences'))")[
|
"import os; print(os.path.join(os.getenv('HOME'), 'Library/Application Support/Google/Chrome/Default/Preferences'))")[
|
||||||
'output'].strip()
|
'output'].strip()
|
||||||
elif os_type == 'Linux':
|
elif os_type == 'Linux':
|
||||||
# preference_file_path = env.controller.execute_python_command(
|
|
||||||
# "import os; print(os.path.join(os.getenv('HOME'), '.config/google-chrome/Default/Preferences'))")[
|
|
||||||
# 'output'].strip()
|
|
||||||
preference_file_path = env.controller.execute_python_command(
|
preference_file_path = env.controller.execute_python_command(
|
||||||
"import os; print(os.path.join(os.getenv('HOME'), 'snap/chromium/common/chromium/Default/Preferences'))")[
|
"import os; print(os.path.join(os.getenv('HOME'), '.config/google-chrome/Default/Preferences'))")[
|
||||||
'output'].strip()
|
'output'].strip()
|
||||||
|
# preference_file_path = env.controller.execute_python_command(
|
||||||
|
# "import os; print(os.path.join(os.getenv('HOME'), 'snap/chromium/common/chromium/Default/Preferences'))")[
|
||||||
|
# 'output'].strip()
|
||||||
else:
|
else:
|
||||||
raise Exception('Unsupported operating system')
|
raise Exception('Unsupported operating system')
|
||||||
|
|
||||||
@@ -592,12 +592,12 @@ def get_new_startup_page(env, config: Dict[str, str]):
|
|||||||
"import os; print(os.path.join(os.getenv('HOME'), 'Library/Application Support/Google/Chrome/Default/Preferences'))")[
|
"import os; print(os.path.join(os.getenv('HOME'), 'Library/Application Support/Google/Chrome/Default/Preferences'))")[
|
||||||
'output'].strip()
|
'output'].strip()
|
||||||
elif os_type == 'Linux':
|
elif os_type == 'Linux':
|
||||||
# preference_file_path = env.controller.execute_python_command(
|
|
||||||
# "import os; print(os.path.join(os.getenv('HOME'), '.config/google-chrome/Default/Preferences'))")[
|
|
||||||
# 'output'].strip()
|
|
||||||
preference_file_path = env.controller.execute_python_command(
|
preference_file_path = env.controller.execute_python_command(
|
||||||
"import os; print(os.path.join(os.getenv('HOME'), 'snap/chromium/common/chromium/Default/Preferences'))")[
|
"import os; print(os.path.join(os.getenv('HOME'), '.config/google-chrome/Default/Preferences'))")[
|
||||||
'output'].strip()
|
'output'].strip()
|
||||||
|
# preference_file_path = env.controller.execute_python_command(
|
||||||
|
# "import os; print(os.path.join(os.getenv('HOME'), 'snap/chromium/common/chromium/Default/Preferences'))")[
|
||||||
|
# 'output'].strip()
|
||||||
else:
|
else:
|
||||||
raise Exception('Unsupported operating system')
|
raise Exception('Unsupported operating system')
|
||||||
|
|
||||||
@@ -627,12 +627,12 @@ def get_find_unpacked_extension_path(env, config: Dict[str, str]):
|
|||||||
"import os; print(os.path.join(os.getenv('HOME'), 'Library/Application Support/Google/Chrome/Default/Preferences'))")[
|
"import os; print(os.path.join(os.getenv('HOME'), 'Library/Application Support/Google/Chrome/Default/Preferences'))")[
|
||||||
'output'].strip()
|
'output'].strip()
|
||||||
elif os_type == 'Linux':
|
elif os_type == 'Linux':
|
||||||
# preference_file_path = env.controller.execute_python_command(
|
|
||||||
# "import os; print(os.path.join(os.getenv('HOME'), '.config/google-chrome/Default/Preferences'))")[
|
|
||||||
# 'output'].strip()
|
|
||||||
preference_file_path = env.controller.execute_python_command(
|
preference_file_path = env.controller.execute_python_command(
|
||||||
"import os; print(os.path.join(os.getenv('HOME'), 'snap/chromium/common/chromium/Default/Preferences'))")[
|
"import os; print(os.path.join(os.getenv('HOME'), '.config/google-chrome/Default/Preferences'))")[
|
||||||
'output'].strip()
|
'output'].strip()
|
||||||
|
# preference_file_path = env.controller.execute_python_command(
|
||||||
|
# "import os; print(os.path.join(os.getenv('HOME'), 'snap/chromium/common/chromium/Default/Preferences'))")[
|
||||||
|
# 'output'].strip()
|
||||||
else:
|
else:
|
||||||
raise Exception('Unsupported operating system')
|
raise Exception('Unsupported operating system')
|
||||||
|
|
||||||
|
|||||||
@@ -7,14 +7,14 @@
|
|||||||
{
|
{
|
||||||
"type": "execute",
|
"type": "execute",
|
||||||
"parameters": {
|
"parameters": {
|
||||||
"command": "echo lixiaochuan20 | sudo -S apt update -y && echo lixiaochuan20 | sudo -S apt install jq -y",
|
"command": "echo password | sudo -S apt update -y && echo password | sudo -S apt install jq -y",
|
||||||
"shell": true
|
"shell": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "execute",
|
"type": "execute",
|
||||||
"parameters": {
|
"parameters": {
|
||||||
"command": "cd /home/user/snap/chromium/common/chromium/Default && jq '. + {\"session\":{\"restore_on_startup\":4, \"startup_urls\":[\"http://funbrain.com/\"]}}' Preferences > temp && mv temp Preferences",
|
"command": "cd /home/user/.config/google-chrome/Default && jq '. + {\"session\":{\"restore_on_startup\":4, \"startup_urls\":[\"http://funbrain.com/\"]}}' Preferences > temp && mv temp Preferences",
|
||||||
"shell": true
|
"shell": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
{
|
{
|
||||||
"type": "execute",
|
"type": "execute",
|
||||||
"parameters": {
|
"parameters": {
|
||||||
"command": "echo lixiaochuan20 | sudo -S apt-get update -y && echo lixiaochuan20 | sudo -S apt-get install unzip -y && unzip /home/user/Desktop/helloExtension.zip -d /home/user/Desktop/ && rm /home/user/Desktop/helloExtension.zip",
|
"command": "echo password | sudo -S apt-get update -y && echo password | sudo -S apt-get install unzip -y && unzip /home/user/Desktop/helloExtension.zip -d /home/user/Desktop/ && rm /home/user/Desktop/helloExtension.zip",
|
||||||
"shell": true
|
"shell": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user