[snap] chromium launch script forces own start-url when it shouldnt (headless mode)

Bug #1894216 reported by miccs
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
chromium-browser (Ubuntu)
Fix Released
Medium
Olivier Tilloy

Bug Description

it is copied from : https://bugs.launchpad.net/ubuntu/+source/snap/+bug/1893020

-------------------------
the problem is "/snap/chromium/current/bin/chromium.launcher" script,
to be precise these 2 lines below:
exec "$SNAP/usr/lib/chromium-browser/chrome" --no-default-browser-check --no-first-run --password-store=$PASSWORD_STORE $FLASH_OPTIONS $CHROMIUM_FLAGS "$@" "$FIRSTRUN_PAGE"

and

"$SNAP/usr/lib/chromium-browser/chrome" --user-data-dir=$TEMP_PROFILE --no-default-browser-check --no-first-run --password-store=$PASSWORD_STORE $FLASH_OPTIONS $CHROMIUM_FLAGS "$@" "$FIRSTRUN_PAGE"

when --headless options is used "$FIRSTRUN_PAGE" parameter shall never be passed here as user specify his own page here and because of that chromium gives:

"[0826/093125.490825:ERROR:headless_shell.cc(174)] Open multiple tabs is only supported when remote debugging is enabled."

ive patched this script in my snap directory (which is tricky) like this:
copied whole folder "/snap/chromium/1284/bin" to other dir on the disk,
patched script,
then did "sudo mount --bind -o nodev,ro /media/data/chromsc /snap/chromium/1284/bin"

and voila this works

so the solution would be to check if user is passing --headless parameter and if he passes his own site - if so then dont pass "$FIRSTRUN_PAGE" parameter

---------------------------------------

additional info regarding solution:

one doesnt need to check if user adds own site because --headless mode can start without website provided, so its enough just to check if user provided --headless parameter.

ive added a patch - which is tested - works perfectly fine.

Tags: snap
Revision history for this message
miccs (meomic) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "chromium.launcher.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Olivier Tilloy (osomon)
tags: added: snap
removed: patch
Changed in chromium-browser (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Olivier Tilloy (osomon)
Revision history for this message
Olivier Tilloy (osomon) wrote :
Changed in chromium-browser (Ubuntu):
status: Confirmed → Fix Committed
Revision history for this message
Olivier Tilloy (osomon) wrote :

Thanks miccs, the above commit is largely inspired by your patch.

Olivier Tilloy (osomon)
Changed in chromium-browser (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Olivier Tilloy (osomon) wrote :

For the record, this bug was making the sabnzbdplus autopkgtests fail (seen on arm64 from 2020-08-26 to 2020-09-04), because they use chromedriver with the "--headless" parameter.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.