diff --git a/built/brave/puppeteer.js b/built/brave/puppeteer.js index 95ee7af..db53735 100644 --- a/built/brave/puppeteer.js +++ b/built/brave/puppeteer.js @@ -23,6 +23,10 @@ const disabledBraveFeatures = [ 'TextClassification', 'SiteVisit', ]; +const disabledChromeFeatures = [ + 'IPH_SidePanelGenericMenuFeature', +]; +const disabledFeatures = disabledBraveFeatures.concat(disabledChromeFeatures); const profilePathForArgs = (args) => { const logger = getLogger(args); // The easiest case is if we've been told to use an existing profile. @@ -51,12 +55,14 @@ export const puppeteerConfigForArgs = (args) => { const { profilePath, shouldClean } = profilePathForArgs(args); process.env.PAGEGRAPH_OUT_DIR = args.outputPath; const chromeArgs = [ + '--ash-no-nudges', '--deny-permission-prompts', '--disable-brave-update', '--disable-breakpad', '--disable-component-extensions-with-background-pages', '--disable-component-update', - '--disable-features=' + disabledBraveFeatures.join(','), + '--disable-features=' + disabledFeatures.join(','), + '--disable-first-run-ui', '--disable-infobars', '--disable-ipc-flooding-protection', '--disable-notifications', diff --git a/changelog.md b/changelog.md index b2cb99b..c16f99a 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,10 @@ +Version 1.1.0 +--- + +Also pass `--disable-first-run-ui`, to suppress some additional, unneeded and +unwanted browser UI, and disable the Chrome `IPH_SidePanelGenericMenuFeature` +for the same reason. + Version 1.0.2 --- diff --git a/package.json b/package.json index bb9c6c5..b474893 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pagegraph-crawl", - "version": "1.0.4", + "version": "1.1.0", "description": "CLI for crawling with PageGraph.", "scripts": { "lint": "npx eslint src/**/*.ts src/*.ts", diff --git a/src/brave/puppeteer.ts b/src/brave/puppeteer.ts index 4e51ecc..3f5d819 100644 --- a/src/brave/puppeteer.ts +++ b/src/brave/puppeteer.ts @@ -33,6 +33,12 @@ const disabledBraveFeatures = [ 'SiteVisit', ] +const disabledChromeFeatures = [ + 'IPH_SidePanelGenericMenuFeature', +] + +const disabledFeatures = disabledBraveFeatures.concat(disabledChromeFeatures) + interface ProfilePath { profilePath: FilePath shouldClean: boolean @@ -74,12 +80,14 @@ export const puppeteerConfigForArgs = (args: CrawlArgs): PuppeteerConfig => { process.env.PAGEGRAPH_OUT_DIR = args.outputPath const chromeArgs = [ + '--ash-no-nudges', '--deny-permission-prompts', '--disable-brave-update', '--disable-breakpad', '--disable-component-extensions-with-background-pages', '--disable-component-update', - '--disable-features=' + disabledBraveFeatures.join(','), + '--disable-features=' + disabledFeatures.join(','), + '--disable-first-run-ui', '--disable-infobars', '--disable-ipc-flooding-protection', '--disable-notifications', diff --git a/src/run.ts b/src/run.ts index b387331..c38099f 100644 --- a/src/run.ts +++ b/src/run.ts @@ -19,17 +19,17 @@ parser.add_argument('-v', '--version', { }) parser.add_argument('-b', '--binary', { help: 'Path to the PageGraph enabled build of Brave. If not provided, ' - + 'try to guess where the binary is, or if its in $PATH', + + 'try to guess where the binary is, or if its in $PATH', }) parser.add_argument('-r', '--recursive-depth', { default: 1, help: 'If provided, choose a link at random on page and do another crawl ' - + 'to this depth. Default: 1 (no recursion).', + + 'to this depth. Default: 1 (no recursion).', }) parser.add_argument('-o', '--output', { help: 'Path to write to. If a directory is provided, then results are ' - + 'written to a file in that directory. If a full path is given, ' - + 'then results are written to that path.', + + 'written to a file in that directory. If a full path is given, ' + + 'then results are written to that path.', required: true, }) parser.add_argument('-u', '--url', { @@ -38,11 +38,11 @@ parser.add_argument('-u', '--url', { }) parser.add_argument('-e', '--existing-profile', { help: 'The chromium profile to use when crawling. Cannot ' - + 'be used with "--persist-profile"', + + 'be used with "--persist-profile"', }) parser.add_argument('-p', '--persist-profile', { help: 'If provided, the user profile will be saved at this path. Cannot ' - + 'be used with "--existing-profile"', + + 'be used with "--existing-profile"', default: false, action: 'store_true', }) @@ -52,7 +52,7 @@ parser.add_argument('--extensions-path', { }) parser.add_argument('-s', '--shields', { help: 'Whether to measure with shields up or down. Ignored when using ' - + `"--existing-profile". Default: ${defaultShieldsSetting}`, + + `"--existing-profile". Default: ${defaultShieldsSetting}`, choices: ['up', 'down'], default: defaultShieldsSetting, }) @@ -68,7 +68,7 @@ parser.add_argument('--logging', { }) parser.add_argument('-i', '--interactive', { help: 'Suppress use of Xvfb to allow interaction with spawned ' - + 'browser instance', + + 'browser instance', action: 'store_true', default: false, }) @@ -82,12 +82,12 @@ parser.add_argument('--proxy-server', { }) parser.add_argument('-x', '--extra-args', { help: 'Pass JSON_ARRAY as extra CLI argument to the browser ' - + 'instance launched.', + + 'instance launched.', metavar: 'JSON_ARRAY', }) parser.add_argument('-c', '--crawl-duplicates', { help: 'Enable crawls for redirected URLs that are already present in ' - + 'the redirection chain.', + + 'the redirection chain.', action: 'store_true', default: false, })