mirror of
https://github.com/pirate/ArchiveBox.git
synced 2025-08-18 04:11:57 +02:00
add chrome sandbox option
This commit is contained in:
@@ -25,6 +25,7 @@ from config import (
|
|||||||
FETCH_FAVICON,
|
FETCH_FAVICON,
|
||||||
WGET_USER_AGENT,
|
WGET_USER_AGENT,
|
||||||
CHROME_USER_DATA_DIR,
|
CHROME_USER_DATA_DIR,
|
||||||
|
CHROME_SANDBOX,
|
||||||
TIMEOUT,
|
TIMEOUT,
|
||||||
ANSI,
|
ANSI,
|
||||||
ARCHIVE_DIR,
|
ARCHIVE_DIR,
|
||||||
@@ -498,6 +499,8 @@ def fetch_favicon(link_dir, link, timeout=TIMEOUT):
|
|||||||
|
|
||||||
def chrome_headless(binary=CHROME_BINARY, user_data_dir=CHROME_USER_DATA_DIR):
|
def chrome_headless(binary=CHROME_BINARY, user_data_dir=CHROME_USER_DATA_DIR):
|
||||||
args = [binary, '--headless'] # '--disable-gpu'
|
args = [binary, '--headless'] # '--disable-gpu'
|
||||||
|
if not CHROME_SANDBOX:
|
||||||
|
args.append('--no-sandbox')
|
||||||
default_profile = os.path.expanduser('~/Library/Application Support/Google/Chrome/Default')
|
default_profile = os.path.expanduser('~/Library/Application Support/Google/Chrome/Default')
|
||||||
if user_data_dir:
|
if user_data_dir:
|
||||||
args.append('--user-data-dir={}'.format(user_data_dir))
|
args.append('--user-data-dir={}'.format(user_data_dir))
|
||||||
|
@@ -46,6 +46,8 @@ TEMPLATES_DIR = os.path.join(PYTHON_PATH, 'templates')
|
|||||||
# ********************** Do not edit below this point **************************
|
# ********************** Do not edit below this point **************************
|
||||||
# ******************************************************************************
|
# ******************************************************************************
|
||||||
|
|
||||||
|
CHROME_SANDBOX = os.getenv('CHROME_SANDBOX', 'True' ).lower() == 'true'
|
||||||
|
|
||||||
### Terminal Configuration
|
### Terminal Configuration
|
||||||
TERM_WIDTH = shutil.get_terminal_size((100, 10)).columns
|
TERM_WIDTH = shutil.get_terminal_size((100, 10)).columns
|
||||||
ANSI = {
|
ANSI = {
|
||||||
|
Reference in New Issue
Block a user